Your go-to repository for code snippets
Project description
Codarcane
Your go-to repository for code snippets.
About
Codarcane is a simple Python command-line tool that allows you to manage and organize your code snippets. You can add, display, search, delete, and copy your code snippets to the clipboard with ease. This tool is built with Click, a Python package for creating command line interfaces.
If you prefer a visual walkthrough, I've created a YouTube tutorial where I explain the package and its features. You can watch it here:
Building a CLI Code Snippet Manager with Python Click
Quick Setup
Install the package as follows:
pip install codarcane
Usage
Adding a Snippet
To add a new code snippet, use the add
command:
codarcane add
You will prompted to enter the snippet title, language, and the code itself.
Displaying Snippets
To display all your code snippets, use the display
command:
codarcane display
This command will list all your snippets with their titles, languages, and code.
Searching for Snippets
You can search for specific snippets using the search
command. Provide a keyword as an argument to find matching snippets by title or language:
codarcane search keyword
Editing a Snippet
To edit an existing code snippet, use the edit
command:
codarcane edit
You will be presented with a list of snippets to choose from. Enter the number corresponding to the snippet you want to edit. You can then choose to edit the title, language, or code.
Copying a Snippet to Clipboard
If you want to copy a snippet's code to your clipboard, use the copy
command:
codarcane copy
You will be presented with a list of snippets to choose from. Enter the number corresponding to the snippet you want to copy.
Deleting a Snippet
To delete a snippet, use the delete
command:
codarcane delete
You will be presented with a list of snippets to choose from. Enter the number correspoding to the snippet you want to delete.
Exporting a Snippet
You can export your code snippets to different format for sharing or backup purposes using the export
command. Choose the export format (markdown or text) and specify the output file.
Markdown:
codarcane export output.md
Or, text:
codarcane export output.txt
Data Storage
Your code snippets are stored in a JSON file named snippets.json
within the snippet folder. This folder is automatically created on your computer. Make sure not to delete or modify this file manually, as it may lead to data loss.
Contributing
If you'd like to contribute to this project, please fork the repository, make your changes, and submit a pull request. I welcome any improvements or bug fixes. You can also submit issues on GitLab for bug reports or feature requests.
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 codarcane-0.0.3.tar.gz
.
File metadata
- Download URL: codarcane-0.0.3.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbda4c29a4c7fd8c327ecdbc4d96d076b90a0c1629eb1cbb5c9a4c2bb82cdc9d |
|
MD5 | c0d96d9cba83d6752a2e5f9964616ff0 |
|
BLAKE2b-256 | c1157d64f0c00c50603d577a05adff6509fa7fd1b5922fa1a17c5bbaf934b07b |
File details
Details for the file codarcane-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: codarcane-0.0.3-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c096f3b7bc7f9e8b6ad90bbd24ccb2ed93f03198568b0d69a2430aa82623ffee |
|
MD5 | cb1038f1696dd4070edd9c6b2400488a |
|
BLAKE2b-256 | 3ce1a652b364239f8e8d2a2addf56183b29a9195b0959cd16231cddee4bc52c2 |