Skip to main content

Generates code headers for your text files

Project description

codesec

Installation

$ pip install codesec

Dependencies

Python dependencies included during pip install:

  • pyperclip

No other dependencies on Windows and Mac OS.

Other systems may need to install xclip or xsel packages

Usage

usage: codesec [-h] [-s] [--symbols] [--reset] [title]

Create pretty printed section title for your code

positional arguments:
  title        title of your section

optional arguments:
  -h, --help   show this help message and exit
  -s , --set   configure settings: length, outer_corners, inner_corners,
               outer_edges, inner_edges, center_fill, comment
  --symbols    prints out common ascii symbols for decoration
  --reset      reset config

Example:

$ codesec --set delimiter
Default delimiter: "# h "
Current delimiter: "# h "
Enter setting: "# !h "
$ codesec src tests example.py
Found 4 files
Editing src/app.py
Editing src/utils.py
Editing tests/test_func.py
Editing example.py

Before:

# app.py

# !h Boring Functions

def bar():
    pass

# !h Cool Functions

def foo():
    print("Somthing cool")

def main():
    foo()

After:

# app.py

# +------------╔══════════════════╗------------+ #
# |::::::::::::║ Boring Functions ║::::::::::::| #
# +------------╚══════════════════╝------------+ #

def bar():
    pass

# +-------------╔════════════════╗-------------+ #
# |:::::::::::::║ Cool Functions ║:::::::::::::| #
# +-------------╚════════════════╝-------------+ #

def foo():
    print("Somthing cool")

def main():
    foo()

Generate and copy individual sections

$ codesec --set length

Default length: 80
Current length: 80
Enter setting: 50
Preview:
# +--------------╔===============╗-------------+ #
# |::::::::::::::║ Section Title ║:::::::::::::| #
# +--------------╚===============╝-------------+ #

$ codesec --set inner_edges

Default inner_edges: =,=,║,║
Current inner_edges: =,=,║,║
Enter setting: ≡+,≡+,►,◄
Preview:
# +--------------╔≡+≡+≡+≡+≡+≡+≡+≡╗-------------+ #
# |::::::::::::::► Section Title ◄:::::::::::::| #
# +--------------╚≡+≡+≡+≡+≡+≡+≡+≡╝-------------+ #

$ codesec -t "My Section"

Copied:
# +---------------╔≡+≡+≡+≡+≡+≡+╗---------------+ #
# |:::::::::::::::► My Section ◄:::::::::::::::| #
# +---------------╚≡+≡+≡+≡+≡+≡+╝---------------+ #

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

codesec-0.2.4.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

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

codesec-0.2.4-py2.py3-none-any.whl (16.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file codesec-0.2.4.tar.gz.

File metadata

  • Download URL: codesec-0.2.4.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.26.0

File hashes

Hashes for codesec-0.2.4.tar.gz
Algorithm Hash digest
SHA256 851078ef51707ac861d109ab9959fe3d254961e1a3924c8893efb921eb3dba34
MD5 69e413f032984a1de5dd33226d289c8d
BLAKE2b-256 62fa862d11adec44e4de03d9a8a526a2c09cba64078889223207aaec175b9373

See more details on using hashes here.

File details

Details for the file codesec-0.2.4-py2.py3-none-any.whl.

File metadata

  • Download URL: codesec-0.2.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.26.0

File hashes

Hashes for codesec-0.2.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 59a5da8f578f061fcd5d0200041be0fa261c4463d8498bbf5024895f81df7f3c
MD5 6d26fd56d81d5e0c29c92de2a59b17d7
BLAKE2b-256 02effc24f324b35dfd3635528ff8fbab5d48666940273a8b7a56f8eef4a26036

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