Skip to main content

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

Metadata

Release files for cpcctool 0.0.3

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

Source distribution (sdist)

Source distribution for cpcctool 0.0.3
File Size Uploaded Provenance Actions
cpcctool-0.0.3.tar.gz 3.7 kB Without provenance Details for cpcctool-0.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cpcctool 0.0.3
File Interpreter ABI Platform Actions
cpcctool-0.0.3-py3-none-any.whl Python 3 none any Details for cpcctool-0.0.3-py3-none-any.whl

Total release size: 9.6 kB

Release files / cpcctool-0.0.3.tar.gz

Download URL cpcctool-0.0.3.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
cef73e57a9c8e1db454a0a6b25359b5a4493282951790f5091e224bed355d586
BLAKE2b-256 checksum
How to use checksums
703a90ba7f82a0440de4e2a4091a7cd31803e9b1fa6295adc436bb615678c52c
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / cpcctool-0.0.3-py3-none-any.whl

Download URL cpcctool-0.0.3-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fc075d69d48c35510e45960b7e5bdb4a5f6c2546007ea8f4c0b8a83932a57f8a
BLAKE2b-256 checksum
How to use checksums
a42789e9c435d71caba9d4a275494c649492584e1c72da7414a7892eb2920e0f
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for cpcctool 0.0.3

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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