Skip to main content

pyfoobar

PyPi Version PyPI pyversions GitHub stars PyPi downloads

gh-actions CircleCI travis codecov LGTM Code style: black

A Python project template that highlights some best practices in Python packaging. Can be used as a GitHub template for your new Python project.

Best practices

  • The name of the Git repository should be the PyPi name of the package and should be what you type as import mypackagename. That means no hyphens in package names!

  • Your package should be a one-trick pony. Nobody wants to install a huge toolbox if all they need is the image converter in it.

  • Choose a license for your code and provide a LICENSE[.txt] in the root level of your package as well as a statement in your main README. choosealicense.com can help you make a decision.

  • Use linting and formatting, include those in your integration tests.

    • black is a formatter that I like because you cannot configure it -- black is black.
    • Good linters are flake8 and pylint.
    • isort sorts your imports.
    • pre-commit has gained some popularity. It runs your linters and formatters on every commit. Not more "lint fix" commits.
  • Once you have tests in order, make sure they are executed with every git push. Popular CI services that run your tests are GitHub Actions, Travis CI, and CircleCI. This repository contains the config files for each of them.

  • Make sure that nobody can push to main. On GitHub, go to Settings -> Branches -> Add rule and select Require status checks to pass before merging and Include administrators. Development happens in pull requests, this makes sure that nobody -- including yourself -- ever accidentally pushes something broken to main.

  • Use a tool for measuring test coverage. codecov is one, and your CI provider submits the data to it.

  • If you have CI set up, want to show test coverage, or advertise the availability on PyPi, do so using a badge at the top of your README. Check out shields.io for what's available.

  • Include contributing guidelines and a code of conduct (edit to add appropriate enforcement contacts or use a template) to help foster a community.

What you can do with this template

First run

find . -type f -print0 -name "*.py" -o -name "*.yml" | xargs -0 sed -i 's/pyfoobar/your-project-name/g'

and rename the folder src/pyfoobar to customize the name.

There is a simple justfile that can help you with certain tasks:

  • Run just format to apply formatting.

  • Run just lint to check formatting and style.

  • Run just publish to

    • tag your project on git (just tag)
    • upload your package to PyPi (just upload)

    After publishing, people can install your package with

    pip install pyfoobar
    

Testing

To run the pyfoobar unit tests, check out this repository and do

tox

License

This software is published under the MIT license.

Release files for texdown 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for texdown 0.0.6
File Size Uploaded
texdown-0.0.6.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for texdown 0.0.6
File Interpreter ABI Platform
texdown-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 11.1 kB

Release files / texdown-0.0.6.tar.gz

Download URL texdown-0.0.6.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f71b1c202d780f3a83937dd818b49baf93e604a64ea2d64553b1deea2b0db66b
BLAKE2b-256 checksum
How to use checksums
2bd035e5e95e9d380a72568c3f80f32dcf9c637842db67bc3dfae0f27258f8c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

Release files / texdown-0.0.6-py3-none-any.whl

Download URL texdown-0.0.6-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a73a26e51fa755b3f2011ee9aebe0d833437c3d74aab9611e04a1362253e6e39
BLAKE2b-256 checksum
How to use checksums
26453067f3ddbb4f3225b245f2c2cd75033b2e9dda9d0a7404e45878c19a4946
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page