Skip to main content

A wrapper for pip, to give better utils to python projects dependency management

Project description

barn

barn is a Python-based command-line interface (CLI) tool that simplifies package management by providing an intuitive set of commands. It was inspired by the yarn counterpart from Javascript. Hence the interface was kept as similar as possible, so that if you are familiar with yarn you should pickup barn relatively fast.

Note Barn is just a pip wrapper, so package resolution is still completely up to pip and your installed pip version

Features

  • Install packages
  • Add new packages
  • Initialize new projects with interactive prompts
  • Ability to define script scoped to your project, like you would do with a package.json

⚠️ A small invite to caution

Barn is still in development and can be unstable. More over:

  • It currently only supports python 3.9 and it is only officially tested on 3.9.13
  • It still lacks core feature that hopefully will be added soon

How to use

You can install barn directly with the following pip command:

Note You are encouraged to install barn globally on your system

pip install python-barn

You can initialise an empty directory to be a barn project by running:

barn init

This will launch an interactive prompt asking for details such as project name, description, author, etc.

In case your project already exists and it's not an empty folder, you can create the project.yaml file with the following content:

name: my-project
description: Some description
version: 0.1.0
author: your-name or your team name
scripts:
  - start: python ./main.py
  - test: echo "Not implemented"
license: your-license

Install project dependencies

barn

or

barn install

Add a new package:

barn add <package-name>

Remove a package:

barn remove <package-name>

To setup custom scripts

In the project.yaml, you can specify bash scripts by adding to the scripts section:

scripts:
  - start: python ./main.py

Once you have your script defined you can run:

barn <script-name>

In this case:

barn start

This will run your script in the context of the project, with the correct python version and pointing to the correct virtual environment

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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

python-barn-0.6.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

python_barn-0.6.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file python-barn-0.6.0.tar.gz.

File metadata

  • Download URL: python-barn-0.6.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for python-barn-0.6.0.tar.gz
Algorithm Hash digest
SHA256 25ac742b5a51ce48110907e0d5e48b1143c5a7790d4fcf1821d9bffd003192b8
MD5 20fe66a8b1fca2b1ba49c6da47ab0d75
BLAKE2b-256 4e9684072ec118d6a88b38efbf1af643beb9791fa0f43829c0151a3e438e35e6

See more details on using hashes here.

File details

Details for the file python_barn-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: python_barn-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for python_barn-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba68205f1e3a9571876349b36faa70e981e7567dd09fdba4ef5b4906864d2fed
MD5 31a1f1fb70b19e16150d4ac13a0e243d
BLAKE2b-256 26a36aa8dacc5b109969481c631a117cf005dfdf5417b9d34bd343abab62c20b

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