semvec/pypi-packages huggingface dataset:
hfdownloader 1.0.2
A package that downloads a model from the HuggingFace Model Hub.
Requires Python: >=3.6

# HFDownloader - Hugging Face Model Downloader

### This package provides the user with one method that downloads a tokenizer and model from [HuggingFace Model Hub](https://huggingface.co/models) to a local path. 

This package utilizes the `transformers` library to download a tokenizer and model using just one method. When a model is downloaded, it will save a state from a loaded tokenizer and model to a local path. If the path does not exist, the method will create one with the title passed.

This Github repo also allows you to run '`hf_downloader.py`' like a script if you don't want to open a python terminal. It has two positional arguments, the model and the pathname you wish the model to save to. Example usage may look something like this in the command line.

    python hf_downloader.py cardiffnlp/twitter-roberta-base-sentiment sentiment_model_path


# Installation
The package can be installed with the following command:

    pip install hfdownloader

# How to Use
Here is a bit of code you can reference to see how to use the package. I will be using another package I released called [HFLoader](https://github.com/Solonce/HFLoader), that simply loads the tokenizer and model. You can do this in any way, this package is not required.

    import hlfloader as hfl
    import hfdownload as hfd
    
    huggingface_model = "cardiffnlp/twitter-roberta-base-sentiment"
    tokenizer, model = hfl.load_model(huggingface_model)
    hfd.save_model("HuggingFaceModelPath", tokenizer, model)
    
    
The code above is the easiest way I have found to save models from the HuggingFace Model Hub locally.

## Requirements
> pip install transformers

**Not required but helpful**
> pip install hfloader

## Notes
I don't have plans to upkeep this project unless it necessitates it. I was able to achieve the goal I had set out when developing the package.
streamlit-custom-sidebar 0.0.16
Streamlit component that allows you to do create a more flexible customisable streamlit sidebar
Requires Python: >=3.7

# streamlit-custom-sidebar

Streamlit component that allows you to do buid a more flexible customizable sidebar that does not look buggy when rendered. Usually when we try to adjust the native streamlit sidebar it gets rendered after all the streamlit default settings are rendered. With this, your default settings are rendered when the page loads but it still uses streamlit's sidebar mative settings - css like its open and close animation and buttons.  

Dependencies:
Uses other custom components I created:
- [local storage](https://pypi.org/project/streamlit-local-storage/)
- [browser session storage](https://pypi.org/project/streamlit-browser-session-storage/)
- [streamlit-extras](https://pypi.org/project/streamlit-extras/)


## Installation instructions

```sh
pip install streamlit-custom-sidebar
```

```
# Pre-requisites

create `.streamlit/config.toml` directory where the main app.py file is located

in there, input 
[ui]
hideSidebarNav=true

or 

start streamlit app with 
`streamlit run app.py --ui.hideSidebarNav=true`
```

## Usage instructions

```python
import streamlit as st
from streamlit_custom_sidebar import CustomSidebarDefault
import streamlit_float # recommended

# Note - on the page's first load - when user comes in from the url rather than clicking on the tab, the active page will be derived from the url or from the `loadPageName` parameter. Please make sure all params in the data array object are inputed.

st.set_page_config(layout="wide")

streamlit_float.float_init(theme=False, include_unstable_primary=False)

# iconLib (key,variable in the data list of dicts - its required) -> "Remix", "Tabler", "Google"
data_ = [
            {"index":0, "label":"Example", "page":"example", "href":"http://localhost:8501/"},
            {"index":1, "label":"Page", "page":"page", "iconLib":"Google", "icon":"settings", "href":"http://localhost:8501/page"}
        ]

if "currentPage" not in st.session_state: # required as component will be looking for this in session state to change page via `switch_page`
    st.session_state["currentPage"] = data_[0] 
else:
    st.session_state["currentPage"] = data_[0] 


with st.container():
    defaultSidebar = CustomSidebarDefault(closeNavOnLoad=False, backgroundColor="brown", loadPageName="example", data=data_, LocalOrSessionStorage=1, serverRendering=False, webMedium="local") 
    defaultSidebar.load_custom_sidebar()
    defaultSidebar.change_page()
    
    streamlit_float.float_parent(css="position:fixed; top:-1000px;") # gets rid of the whitespace created from the iframes used to build the component - no big forehead.

# The above must be rendered atop every streamlit page

```
py-i-art 0.1.1
I-ART: A Generalized Framework for Imputation-Assisted Randomization Tests
Requires Python: >=3.8

# I-ART: Imputation-Assisted Randomization Tests

## Authors

Jiawei Zhang*, Siyu Heng*, and Yang Feng (* indicates equal contribution)

## Maintainers

Jiawei Zhang (Email: jz4721@nyu.edu), Siyu Heng (Email: siyuheng@nyu.edu), and Yang Feng (Email: yang.feng@nyu.edu)

## Description

I-ART (Imputation-Assisted Randomization Tests) is a Python package designed for conducting finite-population-exact randomization tests in design-based causal studies with missing outcomes. It offers a robust solution to handle missing data in causal inference, leveraging the potential outcomes framework and integrating various outcome imputation algorithms.

## Installation

To install [I-ART](https://pypi.org/project/py-i-art/), run the following command:

```bash
pip install py-i-art
```

## Usage

Here is a basic example of how to use I-ART:

```python
import numpy as np
from i_art import iartest

Z = np.array([1, 1, 1, 1, 0, 0, 0, 0])
X = np.array([[5.1, 3.5], [4.9, np.nan], [4.7, 3.2], [4.5, np.nan], [7.2, 2.3], [8.6, 3.1], [6.0, 3.6], [8.4, 3.9]])
Y = np.array([[4.4, 0.5], [4.3, 0.7], [4.1, np.nan], [5.0, 0.4], [1.7, 0.1], [np.nan, 0.2], [1.4, np.nan], [1.7, 0.4]])
result = iartest(Z=Z, X=X, Y=Y, L=1000, verbose=True)
```
Detailed usage can be found here [ReadDoc](https://i-art.readthedocs.io/en/latest/)

## Features

- Conducts finite-population-exact randomization tests.
- Handles missing data in causal inference studies.
- Supports various outcome imputation algorithms.
- Offers covariate adjustment in exact randomization tests.


## Contributing

Your contributions to I-ART are highly appreciated! If you're looking to contribute, we encourage you to open issues for any bugs or feature suggestions, or submit pull requests with your proposed changes. 

### Setting Up a Development Environment

To set up a development environment for contributing to I-ART, follow these steps:

```bash
python -m venv venv
source venv/bin/activate 
pip install -r requirements.txt
```
This creates a virtual environment (`venv`) for Python and activates it, allowing you to work on the package without affecting your global Python environment.

## License
This project is licensed under the MIT License

## Citation
If you use I-ART in your research, please consider citing it:

```code
@misc{heng2023designbased,
      title={Design-Based Causal Inference with Missing Outcomes: Missingness Mechanisms, Imputation-Assisted Randomization Tests, and Covariate Adjustment}, 
      author={Siyu Heng and Jiawei Zhang and Yang Feng},
      year={2023},
      eprint={2310.18556},
      archivePrefix={arXiv},
      primaryClass={stat.ME}
}
```