Skip to main content

A Python package to generate python package scaffolding based on best practices

Project description

Python package

carcass is a Python command line tool to generate python package scaffolding based on best practices

Getting Started

To use carcass you can run it directly. Since carcass is mainly considered a command line tool, once installed, you run it directly:

# Default generated package path is the current users directory `~/`
carcass

# Provide an alternate path location 
carcass -P ~/my_packages/path
carcass --path ~/my_packages/path

Once you run carcass you will be prompted to provide answers to the following questions:

Enter your package name: mytestpackage
Enter your first and last name: Josh Rickard
Enter your GitHub user name: MSAdministrator
Enter your email address: josh.rickard@letsautomate.it

Additionally, you have additional package options that you can select all, some, or none of them using your space key.

Currently, carcass supports the following additional package options. I will continue to add additional options as needed/wanted:

Please select all package options which you want carcass to generate

 * Logger
   Exceptions
   Microsoft Graph OAuth2
   Flask App

Package Template Structure

carcass generates packages based on your provided inputs as well as selected options during creation.

Below is the structure outline for a template python package generated by carcass with all options selected:

📦test package
  📂test package
   📂app
    📂api
     📜api.py
    📂frontend
     📜frontend.py
    📂templates
     📜404.html
     📜500.html
     📜base.html
     📜index.html
    📜__init__.py
    📜config.py
   📂utils
    📜__init__.py
    📜exceptions.py
    📜logger.py
    📜version.py
   📜__init__.py
   📜__main__.py
   📜graphconnector.py
   📜test package.py
  📜.gitignore
  📜CONTRIBUTING.md
  📜Dockerfile
  📜LICENSE.md
  📜README.md
  📜docker-compose.yml
  📜logger.yml
  📜requirements.txt
  📜setup.py

Installation

In order to use carcass you can install it via pip or clone this repository.

pip install carcass
git clone git@github.com:MSAdministrator/carcass.git
cd carcass
pip install -r requirements.txt

Development

To get a development env running, you can clone this repository

Say what the step will be

pip install --user pipenv
git clone git@github.com:MSAdministrator/carcass.git
cd carcass

Next, install and setup a virtual environment:

pip install virtualenv
virtualenv venv
pip install -r requirements.txt
carcass

Running the tests

To run unit tests, you will need to clone this repository:

pip install --user pipenv
git clone git@github.com:MSAdministrator/carcass.git
cd carcass

Next, you run tests using the following command:

python -m pytest 

Break down into end to end tests

Tests within this package test to ensure that the correct files are being created as requested as well as some tests check the contents of the template files:

# testing the creation of a README.md template

def test_creation_of_readme_template_exists(carcass_fixture):
    '''
    Testing the creation of README.md template file
    '''
    carcass = carcass_fixture.create_package(pytest.configuration['package_path'], pytest.package)
    assert os.path.exists(os.path.join(str(pytest.configuration['package_path']), 'README.md'))

Upcoming Additions

[x] Add Flask application template [] Add Database templates [] Add Celery worker templates [] Add Redis templates [] Add GraphQL templates

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

carcass-1.1.0.tar.gz (18.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

carcass-1.1.0-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

carcass-1.1.0-py2-none-any.whl (24.6 kB view details)

Uploaded Python 2

File details

Details for the file carcass-1.1.0.tar.gz.

File metadata

  • Download URL: carcass-1.1.0.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.9.1

File hashes

Hashes for carcass-1.1.0.tar.gz
Algorithm Hash digest
SHA256 cf4811ad69c3ca41d2bbdaf3d427f8aa5085c8d952d75fa00b1c0bd59a67e729
MD5 1cd9ea0e2789a1d146012afda7e4533c
BLAKE2b-256 829efa8ea6f125c10799cea06798a3cc61f97f5559360629938857a0465a4abf

See more details on using hashes here.

File details

Details for the file carcass-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: carcass-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.9.1

File hashes

Hashes for carcass-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10a402f6e1dcd369cb911446a844f9afdb00e55ae043dca8123bbbba66bf94b9
MD5 833dad433579d964972f55957d0e49ef
BLAKE2b-256 167f8e4e67f0d5217d7ddf00538ab7d134afc38112f5dab5b5868d0fd79168aa

See more details on using hashes here.

File details

Details for the file carcass-1.1.0-py2-none-any.whl.

File metadata

  • Download URL: carcass-1.1.0-py2-none-any.whl
  • Upload date:
  • Size: 24.6 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.9.1

File hashes

Hashes for carcass-1.1.0-py2-none-any.whl
Algorithm Hash digest
SHA256 9affebcf77ef47e764a1d2540782182e80f5b2a9cd60fcbab9353c0ffa5f2abc
MD5 eb636783d818641dbeaea8f55cf0fbe7
BLAKE2b-256 48450357aa5c8643524e6ab4c232f8539422b862a44c9c8364288f5f5d3e7995

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page