टेम्पलेट्स से तेज़ पैकेज डेवलपमेंट

Python पैकेज विकसित करना

James Fulton

Climate informatics researcher

टेम्पलेट्स

  • Python पैकेज में कई अतिरिक्त फाइलें होती हैं
  • याद रखने को बहुत कुछ होता है
  • टेम्पलेट्स इस्तेमाल करने से यह काफी कवर हो जाता है

Package file tree

.
|-- example_package
|   |-- __init__.py
|   `-- example_package.py
|-- tests
|   |-- __init__.py
|   `-- test_example_package.py
|-- README.rst     <-
|-- LICENSE        <-- lots
|-- MANIFEST.in    <-- of
|-- tox.ini        <-- additional
|-- setup.py       <-- files
`-- setup.cfg      <--
Python पैकेज विकसित करना

cookiecutter

  • खाली Python पैकेज बनाने के लिए उपयोग कर सकते हैं
  • आपके पैकेज की सभी अतिरिक्त फाइलें बना देता है

Package file tree

.
|-- example_package
|   |-- __init__.py
|   `-- example_package.py
|-- tests
|   |-- __init__.py
|   `-- test_example_package.py
|-- README.rst
|-- LICENSE
|-- MANIFEST.in
|-- tox.ini
|-- setup.py
`-- setup.cfg
Python पैकेज विकसित करना

cookiecutter का उपयोग

cookiecutter <template-url>
Python पैकेज विकसित करना

cookiecutter का उपयोग

cookiecutter https://github.com/audreyr/cookiecutter-pypackage
Python पैकेज विकसित करना

cookiecutter का उपयोग

cookiecutter https://github.com/audreyr/cookiecutter-pypackage
full_name [Audrey Roy Greenfeld]:
Python पैकेज विकसित करना

cookiecutter का उपयोग

cookiecutter https://github.com/audreyr/cookiecutter-pypackage
full_name [Audrey Roy Greenfeld]: James Fulton




  • अपना नाम भरें और आगे बढ़ने के लिए Enter/Return दबाएँ
Python पैकेज विकसित करना

cookiecutter का उपयोग

cookiecutter https://github.com/audreyr/cookiecutter-pypackage
full_name [Audrey Roy Greenfeld]: James Fulton

email [[email protected]]: [email protected] github_username [audreyr]: MyUsername
project_name [Python Boilerplate]: mysklearn project_slug [mysklearn]: mysklearn
  • Project slug - pip install name में इस्तेमाल होने वाला name
Python पैकेज विकसित करना

cookiecutter का उपयोग

cookiecutter https://github.com/audreyr/cookiecutter-pypackage
...
project_short_description [Python Boilerplate ...]: A Python package for linear 
    regression.

pypi_username [MyUsername]: version [0.1.0]:
Python पैकेज विकसित करना

cookiecutter का उपयोग

cookiecutter https://github.com/audreyr/cookiecutter-pypackage
...
use_pytest [n]: y
use_pypi_deployment_with_travis [y]: n
add_pyup_badge [n]: n
Python पैकेज विकसित करना

cookiecutter का उपयोग

cookiecutter https://github.com/audreyr/cookiecutter-pypackage
...
Select command_line_interface:
1 - Click
2 - Argparse
3 - No command-line interface
Choose from 1, 2, 3 [1]: 3

create_author_file [y]: y
Python पैकेज विकसित करना

cookiecutter का उपयोग

cookiecutter https://github.com/audreyr/cookiecutter-pypackage
...
Select open_source_license:
1 - MIT license
2 - BSD license
3 - ISC license
4 - Apache Software License 2.0
5 - GNU General Public License v3
6 - Not open source
Choose from 1, 2, 3, 4, 5, 6 [1]: 6
Python पैकेज विकसित करना

टेम्पलेट आउटपुट

mysklearn/
|-- mysklearn/
|   |-- __init__.py
|   `-- mysklearn.py
|-- tests/
|   |-- __init__.py
|   `-- test_mysklearn.py
|-- MANIFEST.in
|-- README.rst
|-- requirements_dev.txt
|-- setup.cfg
|-- setup.py
|-- tox.ini

|-- AUTHORS.rst |-- CONTRIBUTING.rst |-- HISTORY.rst `-- Makefile

AUTHORS.rst फाइल के अंदर

=======
Credits
=======

Development Lead
________________

* James Fulton <[email protected]>

Contributors
____________

अभी कोई नहीं. आप पहले क्यों न बनें?
Python पैकेज विकसित करना

टेम्पलेट आउटपुट

mysklearn/
|-- mysklearn/
|-- tests/
|-- MANIFEST.in
|-- README.rst
|-- requirements_dev.txt
|-- setup.cfg
|-- setup.py
|-- tox.ini
...
...
|-- docs/
|-- .github/
|-- .editorconfig
|-- .gitignore
`-- .travis.yml
Python पैकेज विकसित करना

अभ्यास करते हैं!

Python पैकेज विकसित करना

Preparing Video For Download...