Package: yehua
Introductionyehua/’jɛhwa/ is yet another a project template tool for an organisation. It creates a project skeleton, S
from the default project template, T,  of an organisation.moban, the other
tool of moremoban organisation, keeps S in synchronisation with T forever. This
use case is what we called:continuous templating.Cookiecutter usersYes, we now support cookiecutter templates. It has been requested since 2018
Europython. Simply there is tons of cookiecutter templates out there.What you do is to replace ‘cookiecutter’ with ‘yh’:$ pip install yehua[cookiecutter]
$ yh gh:audreyr/cookiecutter-pypackageAnd what moremoban promise is, whenever your source template changes, you
cansynchronizethem any time with another moremoban’s command ‘moban’:$ mobanYes, you need a separate command, which replaces your effort to synchronize
the upstream templates all the time.What’s different with YehuaWhen the scope is a single project,yehuais no different tocookiecutterandPyScaffold. It will create a project skeleton frompypi-mobans, other templates such
as cookiecutter templates, yehua mobans.When the scope is all projects within an organisation,yehuahelps tackle
information fragmentation problem, because all new projects after its creation,
are still in synchronisation with T. For example, removing python 2.7 test
in your travis file, can be done either manually by hand or automatically viamoban. What’s the difference? The latter is faster and typo-free option. Here isan example.PyScaffoldversion 3 has rolled out ‘–update’ option, recognizing the organisational
need of continous templating. Why do notyehuajoinPyScaffold? Well,
moremoban organisation started with ‘–update’ at the start so our architecture
and vision are closer to that ofcookiecutter:we do not want to limit ourselves in pythonsphere. We wanted to serve all
IT projects. In our mind, they are all about text templating.we split the tool and the templates, serving the previous statement.
People can create npm package template and use yehua+moban for continuous templating.
Here are a list of examples:pypkg-mobans in pyecharts projectecharts-js-mobans in echarts-map projectInstallationYou can install yehua via pip:$pipinstallyehuaor clone it and install it:$gitclonehttps://github.com/moremoban/yehua.git$cdyehua$pythonsetup.pyinstallFor offline usage, you need to getpypi-mobans-pkginstalled:$ pip install yehua[pypi-mobans]or:$ pip install pypi-mobans-pkgUsageSimply type in and you are taken care of:$ yhIt will use pypi-mobans-pkg by default and if it is not installed, it will
install latest one. Then pypi-mobans-pkg takes over and will do
[these](https://github.com/moremoban/pypi-mobans/blob/dev/yehua.yml)
for you:Consult you on your project static information which can update as
many as you want to.Create the Python package folder structureInitialize the package as git projectYou will simply need to commit it after you will have reviewed the
generated files.TutorialLet’s make a python command line utility usingyehua. The command
will behelloand it printsworld.Step 1 Let’s launch yehuaStep 2 Fill-in the meta data for your projectAt the end, yehua generates a folder named ‘hello’, which contains [all necessary
files](https://github.com/moremoban/pypi-mobans).Step 3 Start codingIn above animation, we write up the actual code in hello/main.pydefmain():print('world')Why is it enough? yehua generates a command utility python and
it has pre-wired to invoke hello.main.main() function. You
can find it out in setup.py.Step 4 Install itNow all is done. Let’s install itYou can now runhelloat your command line.Step 5 push to githubSuppose you are happy with everything. Please do the following to
push it to your github:$ git commit -am ":sparkle: initial commit"Then create your project repository in github and do these to push it out:$ git remote add origin https://github.com/moremoban/hello.git
$ git push origin masterYou can find thehello projecton github.Step 7 enable travisThe generated project already has.travis.ymlfile. What you
will need to do is to register with travis.org if you have not
done so. And then go to travis and activate your project.BackgroundThe original problem I was trying to solve is: I would like to place
common paragraphs in the documentation of my projects in a central
place (pyexcel-mobans), and all projects could reference it dynamically
so that when those common paragraphs get updated, the updates can be
easily propagated to all relevant projects. The derived problem is:
what can I do to a new project? I found myself doing a lot of
copy-and-paste a lot, which lead to the creation of “yehua”. Later,
John Vandenberg, an active member of coala, suggested extracting the
generic sets of pyexcel-mobans to form pypi-mobans, so that
a vanilla python package can be created. Why not cookiecutter?
Well, I have not heard of it at the time of creation. But it turns out
that this project started to pave the way to be the cookiecutter
for organisations.Why to choose “yehua”? Here isthe little storybehind the
choice of name. And thismusic videowould help bridge the
cultural gap between you and me.LicenseNEW BSD LicenseIt embeds MIT licensedcutiefrom
Hans Schülein. Please refer to LICENSE file for more details3 contributorsIn alphabetical order:Ayan BanerjeeJohn VandenbergThe Gitter BadgerChange log0.1.4 - 14.09.2020Updated#53: parity with
cookiecutter: support gh:audreyr/cookiecutter-pypackage0.1.3 - 13.09.2020Updateduse pypi-mobans v0.1.0no longer, yehua has any template in itself.0.1.2 - 26.08.2020Fixedsupport pypi-mobans v0.0.15.auto-generation of contributorsgithub action for moban update and commitsbetter isort action0.1.1 - 29.05.2020Fixed#62: fix unwanted
dependency for yh standalone use0.1.0 - 19.05.2020Removedpython 2 support has been droppedUpdated-v is changed to do moban style verbose(-v, -vv, -vvv), for version, please
use -VAdded#37: cookiecutter support#38: non-verbose modeadded moban update work flowpython filesystem 2 support. yehua templates and cookiecutter templates can
be in git, zip, s3, etc.0.0.8 - 10-01-2020Added#30: ‘yh -h’ or ‘yh –help’
triggers help text#32: pypi-moban-pkg as
installation extrasenable auto github auto publishinggenerate mit licenseUpdated#35: better error message
when the project name has been made a directory alreadyupdated moban dependency to v0.6.0updated yaml library to ruamel.yaml. PyYAML is out because only one yaml
library is wanted in the organisation.0.0.7 - 6/10/2019Updatedupgrade yehua to use pypi-mobans-pkg version 0.0.7generated project will have azure build pipeline, moban command stage in
travis and local flake8 check0.0.6 - 04/15/2019Updatedupgrade yehua to use pypi-mobans-pkg version 0.0.5generated project will have four new files: pipfile, lint.sh, changelog.yml
and Makefile0.0.5 - 08/11/2018added#6: provide Pipfile for
pipenv0.0.4 - 06/07/2018Updated#11: keep up-to-date with
pypi-mobans0.0.3 - 24/02/2018AddedTo add all files to a git repo is being made optional. The action is
specified ingit-repo-filesunderpost-mobansection. This particular
need arises when it is used to scaffold other type of projects such as npm.0.0.2 - 15/10/2017AddedAutomatically inflate project meta data. One yehua command and typing a few
questions are required before a complete project scaffoldingAutomatically obtain setupmobans repo for previous task.Automatically initialize package as git project and add all project files for
the user to commitRemovedBuilt-in template files are off-loaded to setupmobans, which are more
frequently updated.0.0.1 - 02/07/2017