All Projects → bast → Somepackage

bast / Somepackage

Licence: mpl-2.0
Show how to structure a Python project.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Somepackage

L5modular
Generates and handles Modules for Laravel
Stars: ✭ 188 (-46.44%)
Mutual labels:  structure, modular
Para
Open source back-end server for web, mobile and IoT. The backend for busy developers. (self-hosted or hosted)
Stars: ✭ 389 (+10.83%)
Mutual labels:  api, modular
Flutter Ui Nice
More than 130+ pages in this beautiful app and more than 45 developers has contributed to it.
Stars: ✭ 3,092 (+780.91%)
Mutual labels:  api, layout
Iota.py
PyOTA: The IOTA Python API Library
Stars: ✭ 337 (-3.99%)
Mutual labels:  api
Il Ilce Mahalle Geolocation Rest Api
Türkiye için il ilçe semt veritabanı. Bölgesel bilgiler
Stars: ✭ 338 (-3.7%)
Mutual labels:  api
Confita
Load configuration in cascade from multiple backends into a struct
Stars: ✭ 344 (-1.99%)
Mutual labels:  structure
R2dbc Client
Reactive Relational Database Connectivity
Stars: ✭ 347 (-1.14%)
Mutual labels:  api
Handlebars Layouts
Handlebars helpers which implement layout blocks similar to Jinja, Nunjucks (Swig), Pug (Jade), and Twig.
Stars: ✭ 336 (-4.27%)
Mutual labels:  layout
Jvm
JVM written in Rust
Stars: ✭ 346 (-1.42%)
Mutual labels:  modular
Koa Vue Notes Api
🤓 This is a simple SPA built using Koa as the backend, Vue as the first frontend, and React as the second frontend. Features MySQL integration, user authentication, CRUD note actions, and async/await.
Stars: ✭ 342 (-2.56%)
Mutual labels:  api
Notebooks
interactive notebooks from Planet Engineering
Stars: ✭ 339 (-3.42%)
Mutual labels:  api
Cypress Documentation
Cypress Documentation including Guides, API, Plugins, Examples, & FAQ.
Stars: ✭ 339 (-3.42%)
Mutual labels:  api
Flexlayout
A multi-tab layout manager
Stars: ✭ 340 (-3.13%)
Mutual labels:  layout
Degiro
DEGIRO (unoficial) API
Stars: ✭ 336 (-4.27%)
Mutual labels:  api
Graphql Core
A Python 3.6+ port of the GraphQL.js reference implementation of GraphQL.
Stars: ✭ 344 (-1.99%)
Mutual labels:  api
Socialreaper
Social media scraping / data collection library for Facebook, Twitter, Reddit, YouTube, Pinterest, and Tumblr APIs
Stars: ✭ 338 (-3.7%)
Mutual labels:  api
Allorigins
👽 Pull contents from any page as JSON via API
Stars: ✭ 343 (-2.28%)
Mutual labels:  api
Elasticsearch Java
Elasticsearch Java API 手册
Stars: ✭ 341 (-2.85%)
Mutual labels:  api
Pogo
Server framework for Deno
Stars: ✭ 341 (-2.85%)
Mutual labels:  api
Crypto Exchanges Gateway
Your gateway to the world of crypto !
Stars: ✭ 343 (-2.28%)
Mutual labels:  api

.. image:: https://travis-ci.org/bast/somepackage.svg?branch=master :target: https://travis-ci.org/bast/somepackage/builds .. image:: https://img.shields.io/badge/license-%20MPL--v2.0-blue.svg :target: ../master/LICENSE

Somepackage

Show how to structure a Python project.

Inspired by https://github.com/kennethreitz/samplemod.

Great resources

Recommendations

Please browse this blog post for a good summary of recommendatios and templates: https://medium.com/@jonas.r.kemper/understanding-best-practice-python-tooling-by-comparing-popular-project-templates-6eba49229106

Python 2 or 3?

  • Develop your code under Python 3, test it for both Python 2 and Python 3 but consider Python 3 to be the default today.

Split your code into packages, modules, and functions

  • All code should be inside some function (except perhaps if __name__ == '__main__':).
  • Split long functions into smaller functions.
  • If you need to scroll through a function over several screens, it is probably too long.
  • Functions should do one thing and one thing only.
  • Hide internals with underscores.
  • Organize related functions into modules.
  • If modules grow too large, split them.
  • Import from other modules under somepackage/ using from .somemodule import something.
  • Do file I/O on the "outside" of your code, not deep inside.

Classes vs. functions

  • Do not overuse classes.
  • Prefer immutable data structures.
  • Prefer pure functions.

Naming

  • Give the subdirectory the same name as your package.
  • Before you name your package, check that the name is not taken on https://pypi.org (you may want to upload your package to PyPI one day).

Interfaces

  • In somepackage/__init__.py define what should be visible to the outside.
  • Use https://semver.org.

Testing

Dependency management

  • Package dependencies for developers should be listed in requirements.txt.
  • Alternatively, consider using http://pipenv.readthedocs.io.
  • Package dependencies for users of your code (who will probably install via pip) should be listed in setup.py.

Code style

Type checking

Share your package

Documentation

I used to recommend reStructuredText for READMEs in contrast to Markdown but PyPI no longer requires reStructuredText. You can use Markdown as noted on https://pypi.org/help/ under "How can I upload a project description in a different format?".

Example shown here: https://packaging.python.org/tutorials/packaging-projects/#creating-setup-py

Suggestions? Corrections? Pull requests?

Yes please!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].