CPCC Tool.
Project description
cpcc-tool
Some method for Software copyright application in China, including the generation of source code Word documents, source code statistics, etc.
pip install cpcctool
Example: Generate documentation for the first and last 40 pages of source code
import uuid
import os
from cpcctool import gen_code_docx, docx_first_40_pages, docx_last_40_pages
src_dirs = [
r"F:\workspace\xxx\code1\",
r"F:\workspace\xxx\code2\"
]
dst_file = str(uuid.uuid4()) + ".docx"
gen_code_docx(src_dirs, dst_file)
dst_file = os.path.abspath(dst_file)
docx_first_n_pages(dst_file, r"xxxSystem XXX V2.0.0 Source Code first 40 pages.docx", 40)
docx_last_n_pages(dst_file, r"xxxSystem XXX V2.0.0 Source Code last 40 pages.docx", 40)
Example: Statistics source code total lines
from cpcctool import count_code_lines
src_dirs = [
r"F:\workspace\xxx\code1\",
r"F:\workspace\xxx\code2\"
]
cloc_exe = r"F:\workspace\l2m2\cpcc-tool\cloc-1.84.exe"
count = count_code_lines(cloc_exe, src_dirs)
print(count)
Publish to PyPI
pip install --user --upgrade setuptools wheel twine
python setup.py sdist bdist_wheel
python -m twine upload dist/*
Reference
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
cpcctool-0.0.3.tar.gz
(3.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cpcctool-0.0.3.tar.gz.
File metadata
- Download URL: cpcctool-0.0.3.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cef73e57a9c8e1db454a0a6b25359b5a4493282951790f5091e224bed355d586
|
|
| MD5 |
57a29544baa3e491412a8c369053e380
|
|
| BLAKE2b-256 |
703a90ba7f82a0440de4e2a4091a7cd31803e9b1fa6295adc436bb615678c52c
|
File details
Details for the file cpcctool-0.0.3-py3-none-any.whl.
File metadata
- Download URL: cpcctool-0.0.3-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc075d69d48c35510e45960b7e5bdb4a5f6c2546007ea8f4c0b8a83932a57f8a
|
|
| MD5 |
ea7a81346aaf4040d6de451649156d29
|
|
| BLAKE2b-256 |
a42789e9c435d71caba9d4a275494c649492584e1c72da7414a7892eb2920e0f
|