a local-first tool for managing python dependencies with pip
Project description
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
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file crowbar_package_manager-0.1.15.tar.gz
.
File metadata
- Download URL: crowbar_package_manager-0.1.15.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09f71562b30926c1daad1bf8d42e49661bda1b5076f9fd8f13d7442e7fef7d7d |
|
MD5 | 37246cdad284dc627bf92e08836fb2e5 |
|
BLAKE2b-256 | f753f60da55f76470eb1f244735373ef351a1e353edddf017acbe59092e36262 |
File details
Details for the file crowbar_package_manager-0.1.15-py3-none-any.whl
.
File metadata
- Download URL: crowbar_package_manager-0.1.15-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7239d0987314d0cf89fbb79d451dd96674089c5769ac3b13d91bf89b5a00c3e8 |
|
MD5 | d2dc3ae2159db814d77ca35681ec98b7 |
|
BLAKE2b-256 | ac1c17af7c02f9ad845407e62e0ae05d9522811f2a03b2cd78cae69a0be345a2 |