semvec/pypi-packages huggingface dataset:
collect-db-models 0.0.6
collect sqlalchemy models to one file(eg. __init__.py)
Requires Python: >=3.10

# collect db models

collect sqlalchemy models to one file

## 安装

```sh
pip install collect-db-models
```

## 使用

```sh
flask collect-db-models > {package_name}/models/__init__.py
```

如果没有报错，就可以把文件更名为\_\_init\_\_.py

用下面的语句更简单，也会有一样的效果

```sh
flask collect-db-models -w
```


## Flask项目需要符合下面的结构

```plain
your_project/
│
├──core/
│   └── __init__.py
├──models/
│   └── __init__.py
```

your_project/core/\_\_init\_\_.py

```python
from flask_sqlalchemy import SQLAlchemy

db = SQLAlchemy()
```
grav-sim 1.0.0
Gravity Simulator
Requires Python: >=3.9

# grav_sim

N-body gravity simulation library with C and Python API

Project Homepage and documentations: https://alvinng4.github.io/grav_sim/

**Target Audience:**

* Physics students
* Anyone interested in N-body simulations

**Features:**

* Ten integrators including WHFast and IAS15
* Barnes-Hut algorithm with linear octree
* Particle-Mesh method for cosmological structure formation
* Multiple sample projects

## 5 steps to N-body simulation

A short course to teach beginners how to write fast and clean N-body gravity simulations code in Python.

Homepage: https://alvinng4.github.io/grav_sim/5_steps_to_n_body_simulation/

**Contents**

- [Step 1: Initial setup](5_steps_to_n_body_simulation/step1.md)
- [Step 2: Gravity](5_steps_to_n_body_simulation/step2.md)
- [Step 3: Your first N-body program](5_steps_to_n_body_simulation/step3.md)
- [Step 4: Higher-order algorithms](5_steps_to_n_body_simulation/step4.md)
- [Step 5: Adaptive time-stepping](5_steps_to_n_body_simulation/step5.md)
- [Extra: Plotting and animation](5_steps_to_n_body_simulation/extra.md)
- [Conclusion and Final Project](5_steps_to_n_body_simulation/conclusion.md)

<img src="./examples/media/solar_plus_3d.png" alt="Image" width="300">
<img src="./examples/media/rel_energy.png" alt="Image" width="300">

## Sample projects

### Evolving the solar system for 1 million years

<img src="./examples/media/eccentricity.png" alt="Image" width="300">
<img src="./examples/media/inclination.png" alt="Image" width="300">

### Asteroid belt animation

[![Asteroid belt animation 0](https://img.youtube.com/vi/C45ceYja0jE/0.jpg)](https://www.youtube.com/watch?v=C45ceYja0jE)  
[![Asteroid belt animation 1](https://img.youtube.com/vi/eg7plHjP1eg/0.jpg)](https://www.youtube.com/watch?v=eg7plHjP1eg)  
[![Asteroid belt animation 2](https://img.youtube.com/vi/HMv7OwqAmBY/0.jpg)](https://www.youtube.com/watch?v=HMv7OwqAmBY)

### Formation of Kirkwood gaps

[![Kirkwood gaps 1](https://img.youtube.com/vi/AEyjIF-8zT0/0.jpg)](https://www.youtube.com/watch?v=AEyjIF-8zT0)  
[![Kirkwood gaps 2](https://img.youtube.com/vi/jHLLr7ACvDQ/0.jpg)](https://www.youtube.com/watch?v=jHLLr7ACvDQ)

### Galaxy collision

[![Galaxy collision](https://img.youtube.com/vi/nXTUdjLXwtI/0.jpg)](https://www.youtube.com/watch?v=nXTUdjLXwtI)

### Cosmological structure formation

[![Cosmological structure formation](https://img.youtube.com/vi/yof2x_0IeOA/0.jpg)](https://www.youtube.com/watch?v=yof2x_0IeOA)

## Feedback and Bugs
If you found any bugs or want to leave some feedback, please feel free to let me know by opening an issue or sending an email to alvinng324(at)gmail.com.
PyThinkDesign 0.1.13
python sdk for thinkdesign
Requires Python: >=3.6

# PyThinkDesign

python sdk for thinkdesign

## install

```bash
pip install PyThinkDesign
```

## usage

### 1. Get active TD application
if the TD application is not running, it will be created.

```python
from PyThinkDesign import Application
app = Application.GetActiveApplication()
```

### 2. Create a TD application

```python
from PyThinkDesign import Application
app = Application.Application();

# Set up interactive and visibility mode if necessary.
app.PutVisible(True);
app.PutInteractive(True);
app.Quit();
```



### 3. Create lines and arcs in a document

```python
from PyThinkDesign import Application
from PyThinkDesign import Geo3d

app = Application.Application();
doc=app.GetActiveDocument();

# get creators
curveCreator=doc.GetCurveCreator();

# add lines
p1 = Geo3d.Point(0,0,0)
p2 = Geo3d.Point(1,0,0)
p3 = Geo3d.Point(1,1,0)
p4 = Geo3d.Point(0,1,0)
curveCreator.AddLine(p1,p2)
curveCreator.AddLine(p2,p3)
curveCreator.AddLine(p3,p4)
curveCreator.AddLine(p4,p1)

# add arc
pCenter = Geo3d.Point(10,0,0)
pXDir = Geo3d.Vector(1,0,0)
pYDir = Geo3d.Vector(0,1,0) 
radius = 10
startAng = 0
endAng = 60
curveCreator.AddArc(pCenter, pXDir, pYDir, radius, startAng, endAng)

# save if necessary.
#doc.SaveAs("d:\\tdApp.e3")
app.Quit();
```

### 4. List entities information in a document

```python
from PyThinkDesign import Application
from PyThinkDesign import Geo3d

app = Application.Application();
doc=app.GetActiveDocument();

# get creators
curveCreator=doc.GetCurveCreator();

# add lines
p1 = Geo3d.Point(0,0,0)
p2 = Geo3d.Point(1,0,0)
p3 = Geo3d.Point(1,1,0)
curveCreator.AddLine(p1,p2)
curveCreator.AddLine(p2,p3)

# add arc
pCenter = Geo3d.Point(10,0,0)
pXDir = Geo3d.Vector(1,0,0)
pYDir = Geo3d.Vector(0,1,0) 
radius = 10
startAng = 0
endAng = 60
curveCreator.AddArc(pCenter, pXDir, pYDir, radius, startAng, endAng)

# get entities information
jsonStr=doc.ListInfo()
print(jsonStr)
app.Quit();
```

### 5. how to use AddProfile?

```python
from PyThinkDesign import Application
from PyThinkDesign import Geo3d
import time
app = Application.GetActiveApplication()
doc=app.GetActiveDocument()

# get creators
curveCreator=doc.GetCurveCreator()
profileCreator = doc.GetProfileCreator()
solidCreator = doc.GetSolidCreator()
    
# add lines
p1 = Geo3d.Point(10,0,0)
p2 = Geo3d.Point(50,0,0)
p3 = Geo3d.Point(50,30,0)
p4 = Geo3d.Point(30,30,0)
line1 = curveCreator.AddLine(p1,p2)
line2 = curveCreator.AddLine(p2,p3)
line3 = curveCreator.AddLine(p3,p4)
line4 = curveCreator.AddLine(p4,p1)

lines = [line1.ToSmartId(),line2.ToSmartId(),line3.ToSmartId(),line4.ToSmartId()]
spProfile =profileCreator.AddProfile(lines, False)

# sweep
angle = Geo3d.Angle(5)
swlen = Geo3d.Length(100)
thick = Geo3d.Length(10)
vt = Geo3d.Vector(0, 0, 1)
profSId = spProfile.ToSmartId()
spSweep = solidCreator.AddLinSweep(profSId, angle, swlen,False,False,False, thick, vt)
```