Skip to main content

Python project scaffolder/manager

Project description

Choam

LOC

Python enviroment manager based around making depedency management, and publication easier.

While Python is a simple langauge all-around, managing dependencies and publication aren't. However, Choam automates this, with easy configuration, and simple commands.

Choam, automating the nooks and crannies of Python.

Warning

Choam is currently in beta. If you are not comfortable with this, then use a different dependency manager in the meantime like poetry.

Installation

$ pip install choam

Snippets

The most useful snippets of Choam

Note: Depending on your system's configurations, Choam might have to be prefixed with $ python3 -m like this, $ python3 -m choam <COMMAND>

To create a new project

$ choam new <project_name>

To initialize a project in the current directory

$ choam init <optional: --adapt (adapts the current project to choam's standards)>

Add required dependency

$ choam add <dependency_name>

Install required dependencies of an existing project

$ choam install

Find all required dependencies and update Choam.toml accordingly

$ choam deps

Convert Choam.toml requirements to requirements.txt

$ choam reqs

Setup config files for publication to PyPi according to Choam.toml

$ choam setup

Start publication to PyPi

$ choam publish

Run project entrypoint

$ choam run <filepath_or_script> <optional: --file (to run files instead of scripts)>


Choam.toml quick start

# Choam.toml
[package]
name = "choam"
version = "0.0.0"
description = "Choam is a project manager"
repo = "https://github.com/cowboycodr/choam"
keywords = ["manager"]

So far we've described the package metadata. Including the package name, version, description, and other useful information. This will all be setup when you setup the project with Choam.

Managing dependencies

Managing dependencies with Choam is just as easy as defining the package metadata.

# Choam.toml
[package]
...

[modules]
choam = "*"

The * means it will require the lastest version of the specified module. You can sepcify specific versions if you like: choam = "0.1.18""


Since Choam is in beta, it will sometimes capture unwanted depedencies. To by-pass this behavior define a [modules-ignore] section. Like so:

# Choam.toml
[package]
...

[modules]
...

[modules-ignore]
shutil = "*"

toml is a weird configuration langauge so make sure to include the = "*" after the specified package.


Choam's scripts

To add custom defined scripts to your project all that is required is [script.<YOUR_SCRIPT_NAME>] and a few other parameters. Let's make a format script with python's black, for example.

# Choam.toml
[package]
...

[modules]
...

[modules-ignore]
...

[script.format]
requires = ["black"]
perspective = "${PROJECT}"
command = "${PYTHON} -m black ."

The requires section defines what dependencies are used with the script.

The perspective parameter defines where the script will run relative to the project folder. The ${PROJECT} will run in the project files directory instead of the overall project folder where the Choam.toml, README.md etc. are.

Note: notice how ${PROJECT} is used? When a piece of text is wrapped like ${} this means it is a script variable. Choam provides multiple script variables such as ${PYTHON} to access the active python interpreter, ${CWD} to access the current directory, and ${PROJECT} which is the current working directory. With these script variables you can create very useful scripts that work on any machine.

The perspective parameter defines the actual command that will be run.

Combining all of these with script variables you can create dynmaic, cross-platform, useful, scripts available to anyone.

Running the script:

$ choam run format

In result this will format all of your project files

.choam folder

The .choam folder is specifically for storing Choam related resources. For example: if you have a choam script, and you need to pull from a file, for example. You would put the resource in .choam/scripts/<SCRIPT_NAME>/<FILE>

This project is structured with Choam

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

Choam-1.0.2.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

Choam-1.0.2-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file Choam-1.0.2.tar.gz.

File metadata

  • Download URL: Choam-1.0.2.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for Choam-1.0.2.tar.gz
Algorithm Hash digest
SHA256 0a598b18c71da1cb8defacb5f3728162f41a4612352701f6ef4254d14bbf83ae
MD5 99ba4f813b4c54f83526c936fecd4ef3
BLAKE2b-256 9b954f77e1a42cf2baa4da698969a70d517820fd1266c64edc811510c25def01

See more details on using hashes here.

File details

Details for the file Choam-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: Choam-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for Choam-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4e8952bdeda3108e13cb6a8712688cea86b8d5b4faea0bc5ee9f233e45a70422
MD5 dfa6e1f83e6e83a21fd2048ee49c2c7c
BLAKE2b-256 88bdb2bc0d5f4de7c85d2daf92be9d514be586a3d73c12ba3f01ebf60819531a

See more details on using hashes here.

Supported by

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