{"library":"python-irodsclient","title":"iRODS Python Client","description":"python-irodsclient is a Python API for interacting with iRODS (integrated Rule-Oriented Data System) servers. It provides programmatic access to iRODS data objects, collections, metadata, and authentication mechanisms. The library is currently at version 3.3.0 and typically releases new versions quarterly, incorporating new iRODS features and Python compatibility updates.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install python-irodsclient"],"cli":null},"imports":["from irods.session import iRODSSession","from irods.collection import iRODSCollection","from irods.data_object import iRODSDataObject"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom irods.session import iRODSSession\n\n# Configure iRODS connection parameters using environment variables or defaults\nhost = os.environ.get('IRODS_HOST', 'localhost')\nport = int(os.environ.get('IRODS_PORT', '1247'))\nzone = os.environ.get('IRODS_ZONE', 'tempZone')\nuser = os.environ.get('IRODS_USER', 'rods')\npassword = os.environ.get('IRODS_PASSWORD', 'rods')\n\ntry:\n    # Establish a session with iRODS\n    with iRODSSession(host=host, port=port, zone=zone, user=user, password=password) as session:\n        print(f\"Successfully connected to iRODS zone: {session.zone} as user: {session.user}\")\n\n        # Example: List the contents of the user's home collection\n        home_collection_path = f'/{session.zone}/home/{session.user}'\n        print(f\"\\nListing contents of: {home_collection_path}\")\n        \n        try:\n            collection = session.collections.get(home_collection_path)\n            for item in collection.data_objects:\n                print(f\"  Data Object: {item.name} (size: {item.size})\")\n            for sub_collection in collection.subcollections:\n                print(f\"  Sub-Collection: {sub_collection.name}\")\n        except Exception as e:\n            print(f\"  Could not retrieve collection {home_collection_path}: {e}\")\n\nexcept Exception as e:\n    print(f\"An error occurred during iRODS connection or operation: {e}\")\n    print(\"Please ensure your iRODS server is running and credentials are correct.\")","lang":"python","description":"This quickstart demonstrates how to establish a session with an iRODS server using environment variables for credentials and then list the contents of the user's home collection. It uses `iRODSSession` as the main entry point for all interactions and showcases basic collection traversal.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}