semvec/pypi-packages huggingface dataset:
dwca-writer 0.2.0
Python package for writing Darwin Core Archives (DwC-A)
License: MIT

# dwca-writer

Python package for writing Darwin Core Archives (DwC-A).

## Installation

```
pip install dwca-writer
```

## Quick start

```python
from dwcawriter import Archive, Table
import os
import pandas as pd

df_core = pd.DataFrame(data={
    "occurrenceID": [1, 2, 3],
    "scientificName": ["Abra alba", "Lanice conchilega", "Nereis diversicolor"],
    "notes": ["white", "brown", "green"],
    "year": [2008, 2009, 2010]
})

df_extension = pd.DataFrame(data={
    "id": [1, 2, 3],
    "measurementType": ["temperature", "temperature", "temperature"],
    "measurementValue": [12, 13, 14]
})

archive = Archive()
archive.eml_text = ""

core_table = Table(spec="https://rs.gbif.org/core/dwc_occurrence_2022-02-02.xml", data=df_core, id_index=0, only_mapped_columns=True)
archive.core = core_table

extension_table = Table(spec="https://rs.gbif.org/extension/dwc/measurements_or_facts_2022-02-02.xml", data=df_extension, id_index=0)
archive.extensions.append(extension_table)

print(archive)
```

```
Archive with 1 core tables and 1 extension tables
Table of type http://rs.tdwg.org/dwc/terms/Occurrence with 3 rows and 4 columns
  occurrenceID: http://rs.tdwg.org/dwc/terms/occurrenceID (column 1)
  scientificName: http://rs.tdwg.org/dwc/terms/scientificName (column 2)
  notes
  year: http://rs.tdwg.org/dwc/terms/year (column 3)
Table of type http://rs.tdwg.org/dwc/terms/MeasurementOrFact with 3 rows and 3 columns
  id (column 1)
  measurementType: http://rs.tdwg.org/dwc/terms/measurementType (column 2)
  measurementValue: http://rs.tdwg.org/dwc/terms/measurementValue (column 3)
```

```python
archive.export("dummy.zip")
```
permission-graph 0.1.0a1
A graph based authorization library
License: MIT
Requires Python: >=3.11

# permission-graph

A graph based authorization library


## Overview

The permissions graph consists of Vertices and Edges.

**Vertices**

* `Resource`: a resource with predefined actions requiring authorization
* `Actor`: an identity that will take actions on resources
* `Group`: a named collection of `Actors`
* `Action`: an action on a resource


**Edges**

* `MemberOf`: indicates membership in a collection
    - `Actor -> MemberOf -> Group`
    - `Action -> MemberOf -> Resource`
* `Allow`: indicates positive permission to act on a resource
    - `Actor -> Allow -> Action`
    - `Group -> Allow -> Action`
    - `Action -> Allow -> Action`
* `Deny`: indicates negative permission to act on a resource
    - `Actor -> Deny -> Action`
    - `Group -> Deny -> Action`
    - `Action -> Deny -> Action`

```mermaid
flowchart
    Actor -->|MemberOf|Group -->|Deny| Action -->|MemberOf| Resource
    Actor -->|Allow| Action -->|Allow| Action2 -->|MemberOf| Resource2
```

### Authorizing Access

Authorization to act on a resource is decided by finding the shortest path between
a actor and the action to be performed. If that shortest path is an ALLOW rule, 
the actor is authorized. If that shortest path is a DENY rule, or if there is no
path between the actor and the action, the actor is not authorized.

In the event there is a tie for shortest path, the access will be denied only
if all shortest paths are DENY rules. This behavior can be controlled when
initializing the permission graph via the `tie_breaker_policy` parameter.