semvec/pypi-packages huggingface dataset:
pyfastcore 0.0.6
A python-based implementation for the context-specific metabolic model extraction methods from Vlassis et al. 2014
Requires Python: >=3.6

# pyfastcore

A python implementation of the context-specific model extraction method FastCore by Vlassis et al. (2014)

* Vlassis, N., Pacheco, M. P., & Sauter, T. (2014). PLoS Computational Biology, 10(1) [[Full Article]](http://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1003424)

## INSTALATION

You can install pyfastcore using:
`python setup.py install`

of via pip:
`pip install pyfastcore`

## USAGE EXAMPLE
```
from cobra.test import create_test_model
from pyfastcore import Fastcore

# Loading a toy model of E. coli from cobra.test package
model = create_test_model('textbook')
# Define the list of core reactions
core_reactions = ['Biomass_Ecoli_core', 'ATPM']
# Setting the penalty of exchange fluxes to 0
penalties = {}
for r in model.exchanges:
    penalties[r.id] = 0

# Creating a fastcore solver instnace
fc_builder = Fastcore(model, core_reactions,
                      penalties=penalties,
                      default_penalty=10,
                      debug_mode=True)

# Rnunning fastcore
fc_builder.fast_core()

# checking the list of reaction in the consistent network found
consistent_subnetwork = fc_builder.consistent_subnetwork
print("Consistent subnetworksize set size", len(consistent_subnetwork))
print("Context specific core:")
print(consistent_subnetwork)

# creating a cobra model for the consistent network found
print(f"Building context-specific model for {model.id}")
cs_model = fc_builder.build_context_specific_model()

# Running and FBA using subnetwork model 
print("Running FBA on CS-model")
sol = cs_model.optimize()
print(cs_model.summary())

```


## Citation
If you use this package cite:
* Ponce-De-Leon, M. et al. (2015) Consistency Analysis of Genome-Scale Models of Bacterial Metabolism: A Metamodel Approach. PloS one, 10, e0143626.
amaze-dict 0.0.4
一个便捷的访问多层级dict的方法
Requires Python: >=3.6

# Example Package

**一个便捷的访问多层级dict的方法**

像操作类属性一样访问dict的属性，支持多级访问

针对场景：

针对复杂的多级dict的属性访问，如 user_info = {"name": "xxx", "address": {"city": "xxx", "country": "xxx"}}

老的方式：

```python
user_info = {"name": "xxx", "address": {"city": "xxx", "country": "xxx"}}

# 方式一 （当user_info没有address或address不为dict时，后面get会报错）：
user_info.get("address").get("city")
# 方式二（当user_info没有address或address不为dict时，后面get会报错）：
user_info['address']['city']

# 方式三 (增加多级判断)
(user_info.get("address") or {}).get("city")
```
使用amaze_dict：
```python
from amaze_dict import wrap_value
user_dict = {"name": "xiaoming", "age": 30, "address": {"city": "beijing", "country": "china"}}
user_amaze_dict = wrap_value(user_dict)
print(user_amaze_dict.address.city)
>> output: beijing
print(user_amaze_dict.address.country)
>> output: china
print(user_amaze_dict.contact.phone_num)
>> output: <amaze_dict.amaze_dict.LB_None object at 0x7f8664882cd0>
```
多级访问直接用属性递进查找，不受中间属性没有影响。 可直接对需要的属性进行访问和判断。


### 使用方法

```python
from amaze_dict import wrap_value

user_dict = {"name": "xiaoming", "age": 30, "address": {"city": "beijing", "country": "china"}}
user_amaze_dict = wrap_value(user_dict)

```
访问一级属性：

```shell
>>> print(user_amaze_dict.name)
xiaoming
>>>>print(user_amaze_dict.age)
30
```

访问多级属性：

```shell
>>> print(user_amaze_dict.address.city)
beijing
>>>>print(user_amaze_dict.address.country)
china

```

条件判断：

```shell
判断属性是否存在:
>>> if user_amaze_dict.address.community:
...     print(user_amaze_dict.address.city)
beijing

```