Skip to main content

crowbar


what is it?

Crowbar is a tool for managing your dependencies in Python projects. Inspired by tools like NPM in the JavaScript ecosystem, it installs your dependencies with your project and frees you from the need to think about virtual environments or keep track of your dependencies yourself.


who is it for?

Crowbar is for any Python developer, but it works especially well with someone who uses the vanilla path of dependency management (pip, venv, requirements.txt) and wants to automate some of this workflow.

It's probably not for you if you're deeply embedded in an alternate ecosystem like Conda.


how do I use it?

I'll walk you through the steps of starting a Django project, so you can get a feel for the crowbar mental model.

First, install crowbar:

pip install crowbar-package-manager

Create and/or enter your project directory and then use crowbar to install Django:

crowbar install django

Note: any instance of crowbar can be replaced with cb

crowbar install <package name> uses pip to install your package to a virtual environment folder (named venv by default), records it to requirements.txt, and creates a .gitignore file with venv listed.

Start a new Django project:

crowbar django-admin startproject project_name .

Notice that we didn't need to activate a virtual environment - using crowbar before your command means that it runs using the dependencies in your venv folder automatically.

Run the Django development server:

crowbar manage.py runserver

You can also use crowbar to run a Python file, so in this case you don't put python before manage.py


how does it work?

Crowbar uese pip and venv under the hood. It essentially runs the same commands that you would, but automates the process.

It is worth explaining how crowbar finds the nearest environment folder. It does this by looking for an environment folder at the current directory and progressively looking in higher directories until it finds an environment folder or reaches the root directory. The name of the environment folder it looks for can be changed by the user, but defaults to venv.

The benefit of this search is that you can run crowbar commands from anywhere within your project as long as your dependencies are stored in the main directory of your project.

There is a potential problem though if you have an environment folder in a directory above your current directory. For example, if you have a venv folder on your desktop and then you create a project on your desktop named my_project, enter that directory and type crowbar install pandas, pandas will be installed in the venv folder on your desktop.

If you are concerned that this might be a problem for you, you can simply run crowbar check env to see if crowbar can detect any environment folders at your current directory or above and, if you find any that you want to avoid installing packages to, you can run crowbar create env to force crowbar to create a new environment folder in your current directory.

commands

Note: any instance of crowbar can be replaced with cb

crowbar install <package_name> <package_name>

-Checks to see if there is an environment folder based on the name you've set (venv is the default) in the current directory or in directories above -Creates a virtual environment called venv if it does not exist
-Installs a package (or packages) from pypi into venv
-Updates requirements.txt and creates one if it does not exist

crowbar uninstall <package_name> <package_name>

-Uninstalls a package (or packages) from venv -Updates requirements.txt

crowbar install

-Installs all packages listed in requirements.txt

crowbar <file_name>.py

-Runs a python file using the contents of the local venv

crowbar show name

-Lists the current name of the environment folder that crowbar creates (venv is the default)

crowbar name <environment name>

-Changes the name of the environment folder that crowbar creates (venv is the default)

crowbar check env

-Checks to see if there is an environment folder based on the name you've set (venv is the default) in the current directory or in directories above

crowbar create env

-Creates an environment folder in the current directory based on the name you've set (venv is the default)

crowbar show gitignore

-Indicates whether Crowbar is set to create a .gitignore file when it creates an environment folder (default is to create .gitignore)

crowbar gitignore on

-Instructs Crowbar to create a .gitignore file when it creates an environment folder and add the name of that folder to the .gitignore file (this is the default)

crowbar gitignore off

-Instructs Crowbar not to create a .gitignore file when it creates an environment folder

crowbar show config

-Lists all current configurable settings (environment folder name and gitignore on/off)

Warning – you may have pip muscle memory which may cause you to accidentally install globally. Use crowbar/cb and not pip if you are not in an active virtual environment.


global flag

crowbar --global install <package_name>
cb -g uninstall <package_name>

-installs or uninstalls a package globally


running package commands

With the crowbar command you can run any commands installed in the virtual environment.

Example - starting a new Django project:

cb django-admin startproject project_name .

Running the Django development server:

cb manage.py runserver

package managers other than pip

Crowbar does not support Conda. Crowbar has plans to support UV eventually.

Metadata

Release files for crowbar-package-manager 0.1.16

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

Source distribution (sdist)

Source distribution for crowbar-package-manager 0.1.16
File Size Uploaded Provenance
crowbar_package_manager-0.1.16.tar.gz 5.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for crowbar-package-manager 0.1.16
File Interpreter ABI Platform
crowbar_package_manager-0.1.16-py3-none-any.whl Python 3 none any Details

Total release size: 11.2 kB

Release files / crowbar_package_manager-0.1.16.tar.gz

Download URL crowbar_package_manager-0.1.16.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a3ab2f98f307195e11025cea8ca5d3eb5724ebb90846f46f227b36b13b886cba
BLAKE2b-256 checksum
How to use checksums
61c93da6d4d374517ec7fa93b65c5c379f6d4ad4d20eeedb2233628dfa4ad5c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.3

Release files / crowbar_package_manager-0.1.16-py3-none-any.whl

Download URL crowbar_package_manager-0.1.16-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fc077ec7ef5389a2c7a7d717e26b6751fe988f3690db3dfd64336d3833a5325a
BLAKE2b-256 checksum
How to use checksums
5cfba3bb759ef4d0322db55ab0f8c39d0df0bbc213150a12ca79169ef9e6b93f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.3

Security for crowbar-package-manager 0.1.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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