{"id":6998,"library":"arcp","title":"arcp (Archive and Package) URI parser and generator","description":"arcp is a Python library (current version 0.2.1) designed for creating and parsing arcp (Archive and Package) URIs. These URIs are used to identify or refer to hypermedia files bundled within an archive or application package, such as a ZIP file. The library focuses solely on URI generation and parsing and does not provide functionality for interacting with archive files (like `zipfile`) or making network requests (`urllib.request`). Its release cadence appears slow, with the last update to PyPI in February 2020.","status":"active","version":"0.2.1","language":"en","source_language":"en","source_url":"https://github.com/stain/arcp-py","tags":["uri","parser","archive","package","hypermedia"],"install":[{"cmd":"pip install arcp","lang":"bash","label":"Install with pip"}],"dependencies":[],"imports":[{"note":"While functional, the library's primary interface is through the top-level 'arcp' module, with functions like 'arcp.parse()' and 'arcp.serialize()'.","wrong":"from arcp import parse, serialize","symbol":"arcp","correct":"import arcp"}],"quickstart":{"code":"import arcp\n\n# Example 1: Creating an arcp URI\nuri_str = arcp.serialize(authority='uuid', name='32a423d6-52ab-47e3-a9cd-54f418a48571', path='/doc.html')\nprint(f\"Generated URI: {uri_str}\")\n# Expected: arcp://uuid,32a423d6-52ab-47e3-a9cd-54f418a48571/doc.html\n\n# Example 2: Parsing an arcp URI\nparsed_uri = arcp.parse(\"arcp://ni,sha-256;F-34D4TUeOfG0selz7REKRDo4XePkewPeQYtjL3vQs0/metadata.json\")\nprint(f\"Parsed URI scheme: {parsed_uri.scheme}\")\nprint(f\"Parsed URI authority: {parsed_uri.authority}\")\nprint(f\"Parsed URI path: {parsed_uri.path}\")\nprint(f\"Parsed URI name: {parsed_uri.name}\")\nprint(f\"Parsed URI identifier: {parsed_uri.identifier}\")","lang":"python","description":"This quickstart demonstrates how to create an arcp URI using `arcp.serialize()` and parse an existing arcp URI string into its components using `arcp.parse()`."},"warnings":[{"fix":"If you need to interact with archive contents, combine `arcp` with other Python libraries like `zipfile`, `tarfile`, or network libraries like `urllib.request` or `requests`.","message":"The `arcp` library strictly handles URI parsing and generation. It does NOT provide functionality for accessing, reading, or writing content within actual archive files (e.g., ZIP, JAR) or fetching them via network protocols.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Review the project's GitHub repository (stain/arcp-py) for any new activity before committing to long-term use in critical systems. Consider vendoring if stability is paramount.","message":"The `arcp` library has seen no significant updates or releases since February 2020. While functional for its stated purpose, it may not be actively maintained.","severity":"deprecated","affected_versions":"<=0.2.1"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"The `arcp` library is for URI parsing and generation only. To read an archive, use appropriate Python modules like `zipfile` or `tarfile`. For example: `import zipfile; with zipfile.ZipFile('my_archive.zip', 'r') as zf: ...`","cause":"Attempting to use `arcp` to read the contents of an archive file directly.","error":"AttributeError: module 'arcp' has no attribute 'read_archive'"},{"fix":"`arcp.parse()` is specifically designed for 'arcp' scheme URIs. Ensure the input string starts with 'arcp://' before parsing. For other URI schemes, use `urllib.parse`.","cause":"Trying to parse a non-arcp URI (e.g., an HTTP URL) with `arcp.parse()`.","error":"arcp.InvalidURI: Invalid URI authority 'http'"}]}