forked from stephanepechard/projy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.txt
149 lines (103 loc) · 3.84 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
Projy
=====
**Projy is a template-based skeleton generator**. In one command line,
you can generate project skeletons like Python packages, LaTeX document
or any file structure composed of directories and files.
Each file is generated by a different template. It uses the simple core
templating system from Python, nothing fancy on that part. You can
easily add new templates and new ways to collect data to insert in the
created files. As much as possible, Projy tries to be simple to use and
extend.
See `the complete documentation <http://projy.readthedocs.org/>`__.
Installation
============
If you are familiar with Python, it is strongly suggested that you
install Projy in
`virtualenv <http://pypi.python.org/pypi/virtualenv>`__.
Pip and Distribute
------------------
If you are on Linux or Mac OS X, just type:
::
$ sudo pip install projy
If no pip available, try ``easy_install``:
::
$ sudo easy_install projy
Install from git
----------------
If you prefer git, that is ok too. You can get the very latest code at
Github:
::
$ git clone http://github.com/stephanepechard/projy
Usage
=====
As an example, let's create a Python package. The Projy template mostly
follows recommendations from `The Hitchhiker's Guide to
Packaging <http://guide.python-distribute.org/>`__.
A simple example
----------------
Use simply:
::
$ projy PythonPackage TowelStuff
In the same directory as you typed this command, you now have a
*TowelStuff* directory, with the following structure:
::
TowelStuff/
bin/
bootstrap
CHANGES.txt
docs/
index.rst
LICENSE.txt
MANIFEST.in
README.txt
setup.py
towelstuff/
__init__.py
Each file has been created with a specific template, so the package is
fully functional, yet empty. You can find `further information
here <http://guide.python-distribute.org/creation.html>`__.
Specify substitutions
---------------------
You can specify template substitutions directly from the command line.
Add them at the end of the previous example:
::
$ projy PythonPackage TowelStuff "author,Emmett Brown" "date,1851-09-24"
Then the substitutes *author* and *date* (defaulted to the current day)
are defined by the given values, not those computed by Projy. The format
of such substitutions should be "key,value". Neither the key or the
value should therefore include a comma. Leading and trailing spaces are
removed from both key and value.
To know which substitutions can be overwritten this way, use the *-i*
option as described in the dedicated section. You can add substitutions
that are not listed with the *-i* but they won't have any effect if the
template file does not consider them.
Options
-------
Projy comes with some command line options. Type:
::
$ projy -l
and you'll see the list of available templates in your installation.
That's an easy way to copy/paste the name of the template you want to
use next.
Type
::
$ projy -i PythonPackage
and you'll see the details of the Python package template. It shows the
created directories and files, with the substitutions included in the
template.
Available templates
===================
The currently available templates are:
- a full `Django <http://djangoproject.com>`__ project, following most
of the recommandations from `Two scoops of
Django <https://2scoops.org/>`__ ;
- a `Fabric <http://fabfile.org>`__ file ;
- a `LaTeX <http://www.latex-project.org/>`__ book ;
- a `Python <http://python.org/>`__ package ;
- a Python script ;
- a `Projy <https://github.com/stephanepechard/projy>`__ template,
meta-style.
- a bootstrap file, to manage your virtualenv happiness.
See the official doc for more details on created files into these
templates. Soon to come, more templates around Django. Of course, anyone
can propose some templates, they'll be integrated into Projy.