semvec/pypi-packages huggingface dataset:
QDA 0.0.2
A tool for quantitatively measuring the discursive similarity between bodies of text.
Requires Python: >=2.7

# Quantitative Discursive Analysis

(C) 2019 Mark M. Bailey, PhD

## About
Quantitative Discursive Analysis (QDA) will convert bodies of text into mathematical graph objects built from noun phrases, where each noun or modifier becomes a vertex, and each edge is determined by how the nouns and vertexes are linked within phrases.  The more central the noun is to the overall text content, the higher the centrality measure of that particular noun.  Thus, the graph is a weighted representation of discursive content, making it more robust that simple keyword frequencies.  This object can be used to mathematically compare the discursive content of two or more bodies of text.  This is done by calculating the "resonance" between two bodies of text, where resonance is the cosine angle between the betweenness centralities of the intersection of all vertices.  This resonance value is normalized between [0,1], where 0 indicates no discursive similarity, and 1 indicates perfect discursive similarity.

## Updates
*2022-10-13: Updated resonance function to be more Pythonic.

## More information
This tool is built on NetworkX and TextBlob.  Please see relevant documentation for additional information on what other calculations can be done on NetworkX graph objects generated using this library.

## Download
https://pypi.org/project/QDA/

## Sample Usage

`import QDA`

### Instantiate discursive object.
`text_graph = QDA.discursive_object('This is a string of your text.  For best results, this string should be at least as long as a typical news article.')`

### Calculate resonance between two discursive objects.
`a = QDA.resonate(text_graph_1, text_graph_2)` (noun phrase tuples : list)

### Calculate resonance of discursive objects in series.
`resonance_series = QDA.resonate_as_series(G_list)` (resonance values : dict)

### Calculate resonance between all members of a list.
`d_community = QDA.discursive_community(G_list)`<br>
`d_community.A` (Resonance adjacency matrix : ndarray)<br>
`d_community.G` (Graph objhect built from adjacency matrix : NetworkX object)
starlette-precompressed-static 2022.10.13
A small library for Starlette, to serve pre-compressed static resources
Requires Python: >=3.9
Keywords: brotli,gzip,pre-compressed,resources,starlette,static

starlette-precompressed-static
===

A small library for Starlette, to serve pre-compressed static resources.

## Installation

```
pip install starlette-precompressed-static
```

## Usage

Just replace:

```python
from starlette.staticfiles import StaticFiles

StaticFiles(directory="www")
```

with:

```python
from starlette_precompressed_static import PreCompressedStaticFiles

PreCompressedStaticFiles(directory="www")
```

and you're good to go! By default both brotli and gzip are supported, and brotli is always preferred over gzip.
It is possible to disable one of the algorithms, like so:

```python
PreCompressedStaticFiles(directory="www", gzip=False)
```

## Limitations

This is a very simple implementation, and it has some limitations:

* It wil always try to fetch the compressed version first, and fallback to the uncompressed version if that doesn't exist. This means that if you have some files that should not be compressed (e.g. fonts) they should probably be separated and served by a normal `StaticFiles()`.
* It works by adding `.br` og `.gzip` to the requested path, so it does not support `html` mode were the path may be a folder, or the response a pretty 404.html page.



## A note on older Python versions

This library needs that the Python mimetypes module knows about brotli, which was added in Python 3.9, and therefore only Python 3.9 and newer are supported. It should work fine on older versions as well, but brotli will need to be added to the encodings_map in the mimetypes module, like so:

```python
import mimetypes

if ".br" not in mimetypes.encodings_map:
    # We need brotli to exist in the encodings map, so
    # that brotli encoded files (e.g. xxx.html.br) are
    # detected as the correct file type. This was added
    # in Python 3.9, so on older versions we must add it
    # ourselves.
    mimetypes.encodings_map[".br"] = "br"

```

This may have unexpected side effects, so be aware.
streamlit-wizard 0.0.4
A little streamlit wizard
Requires Python: >=3.7

# streamlit-wizard
This is an example of creating a wizard within Streamlit.

To use it, create your page objects by inheriting from the `Page` class in components,
and pass the resulting pages into the `Wizard` class as illustrated in `main.py`.

## Styling
Some custom CSS styling is used for the container. You can fiddle with it in `static/style.css`

## State
Streamlit session state is used to store the current page and to move data between pages. See `example_pages.py`
for an example of how you can retrieve data stored on previous pages. I've not thought this pattern through
very deeply, please let me know if there's a better way of doing it - obviously handling state in nested
components in complex, see Redux.

## Running
```
pip install -r requirements.txt
streamlit run main.py
```

# Example Usage
```
from streamlit_wizard import components

class IntroPage(Page):
    def render(self) -> dict:
        st.title("Intro")
        st.write("This is the intro page")
        accept = st.radio(
            "Do you understand that",
            options=["Yes", "No", "Can you repeat the question"],
        )
        return dict(accept=accept)


class FirstPageOfQuestions(Page):
    def render(self) -> dict:
        st.title("Question Page")
        st.write("We will have some questions here")

        # We can access the other page state via session storage if we know what it is called
        # This is presumably not a very robust solution

        did_they_accept = st.session_state["page_state"]["intro"]["accept"]
        st.write(f"On the previous page you selected {did_they_accept}")
        fave_bean = st.selectbox(
            "What is your favourite jelly bean colour", ["Red", "Orange", "Green"]
        )
        return dict(fave_bean=fave_bean)


intro = example_pages.IntroPage(name="intro")
data = example_pages.FirstPageOfQuestions(name="questions")

wizard = components.Wizard(pages=[intro, data])

wizard.render()

```

# Publishing
```
python3 -m build && python3 -m twine upload dist/*
```