package-ta 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package_ta-1.0.0/LICENSE.txt +21 -0
- package_ta-1.0.0/PKG-INFO +48 -0
- package_ta-1.0.0/README.md +29 -0
- package_ta-1.0.0/package_ta.egg-info/PKG-INFO +48 -0
- package_ta-1.0.0/package_ta.egg-info/SOURCES.txt +9 -0
- package_ta-1.0.0/package_ta.egg-info/dependency_links.txt +1 -0
- package_ta-1.0.0/package_ta.egg-info/top_level.txt +1 -0
- package_ta-1.0.0/rocket/__init__.py +1 -0
- package_ta-1.0.0/rocket/rocket.py +66 -0
- package_ta-1.0.0/setup.cfg +4 -0
- package_ta-1.0.0/setup.py +15 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 rabia
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: package-ta
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: An awesome package that does something
|
|
5
|
+
Home-page: http://pypi.python.org/pypi/rocket-ta/
|
|
6
|
+
Author: rabia
|
|
7
|
+
Author-email: talebrabia620@gmail.com
|
|
8
|
+
License: LICENSE.txt
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE.txt
|
|
11
|
+
Dynamic: author
|
|
12
|
+
Dynamic: author-email
|
|
13
|
+
Dynamic: description
|
|
14
|
+
Dynamic: description-content-type
|
|
15
|
+
Dynamic: home-page
|
|
16
|
+
Dynamic: license
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
Dynamic: summary
|
|
19
|
+
|
|
20
|
+
# rocket-rabia
|
|
21
|
+
|
|
22
|
+
A small Python package that models rockets for a game or a physics simulation.
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install it.
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install rocket-rabia
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
from rocket import Rocket, Shuttle, CircleRocket
|
|
36
|
+
|
|
37
|
+
r1 = Rocket(0, 0)
|
|
38
|
+
r2 = Rocket(3, 4)
|
|
39
|
+
print(r1.get_distance(r2)) # 5.0
|
|
40
|
+
print(r1 == r2) # False
|
|
41
|
+
|
|
42
|
+
c = CircleRocket(0, 0, 5)
|
|
43
|
+
print(c.get_area()) # 78.53981633974483
|
|
44
|
+
print(c.get_circumference()) # 31.41592653589793
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## License
|
|
48
|
+
[MIT](https://choosealicense.com/licenses/mit/)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# rocket-rabia
|
|
2
|
+
|
|
3
|
+
A small Python package that models rockets for a game or a physics simulation.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install it.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install rocket-rabia
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
from rocket import Rocket, Shuttle, CircleRocket
|
|
17
|
+
|
|
18
|
+
r1 = Rocket(0, 0)
|
|
19
|
+
r2 = Rocket(3, 4)
|
|
20
|
+
print(r1.get_distance(r2)) # 5.0
|
|
21
|
+
print(r1 == r2) # False
|
|
22
|
+
|
|
23
|
+
c = CircleRocket(0, 0, 5)
|
|
24
|
+
print(c.get_area()) # 78.53981633974483
|
|
25
|
+
print(c.get_circumference()) # 31.41592653589793
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## License
|
|
29
|
+
[MIT](https://choosealicense.com/licenses/mit/)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: package-ta
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: An awesome package that does something
|
|
5
|
+
Home-page: http://pypi.python.org/pypi/rocket-ta/
|
|
6
|
+
Author: rabia
|
|
7
|
+
Author-email: talebrabia620@gmail.com
|
|
8
|
+
License: LICENSE.txt
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE.txt
|
|
11
|
+
Dynamic: author
|
|
12
|
+
Dynamic: author-email
|
|
13
|
+
Dynamic: description
|
|
14
|
+
Dynamic: description-content-type
|
|
15
|
+
Dynamic: home-page
|
|
16
|
+
Dynamic: license
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
Dynamic: summary
|
|
19
|
+
|
|
20
|
+
# rocket-rabia
|
|
21
|
+
|
|
22
|
+
A small Python package that models rockets for a game or a physics simulation.
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install it.
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install rocket-rabia
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
from rocket import Rocket, Shuttle, CircleRocket
|
|
36
|
+
|
|
37
|
+
r1 = Rocket(0, 0)
|
|
38
|
+
r2 = Rocket(3, 4)
|
|
39
|
+
print(r1.get_distance(r2)) # 5.0
|
|
40
|
+
print(r1 == r2) # False
|
|
41
|
+
|
|
42
|
+
c = CircleRocket(0, 0, 5)
|
|
43
|
+
print(c.get_area()) # 78.53981633974483
|
|
44
|
+
print(c.get_circumference()) # 31.41592653589793
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## License
|
|
48
|
+
[MIT](https://choosealicense.com/licenses/mit/)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
rocket
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .rocket import Rocket, Shuttle, CircleRocket
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Save as rocket.py
|
|
2
|
+
from math import sqrt, pi
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Rocket():
|
|
6
|
+
# Rocket simulates a rocket ship for a game,
|
|
7
|
+
# or a physics simulation.
|
|
8
|
+
|
|
9
|
+
def __init__(self, x=0, y=0):
|
|
10
|
+
# Each rocket has an (x,y) position.
|
|
11
|
+
self.x = x
|
|
12
|
+
self.y = y
|
|
13
|
+
|
|
14
|
+
def move_rocket(self, x_increment=0, y_increment=1):
|
|
15
|
+
# Move the rocket according to the parameters given.
|
|
16
|
+
# Default behavior is to move the rocket up one unit.
|
|
17
|
+
self.x += x_increment
|
|
18
|
+
self.y += y_increment
|
|
19
|
+
|
|
20
|
+
def get_distance(self, other_rocket):
|
|
21
|
+
# Calculates the distance from this rocket to another rocket,
|
|
22
|
+
# and returns that value.
|
|
23
|
+
distance = sqrt((self.x - other_rocket.x)**2 + (self.y - other_rocket.y)**2)
|
|
24
|
+
return distance
|
|
25
|
+
|
|
26
|
+
def __eq__(self, other):
|
|
27
|
+
# Challenge 01: two rockets are equal if they have the same position.
|
|
28
|
+
if not isinstance(other, Rocket):
|
|
29
|
+
return False
|
|
30
|
+
return self.x == other.x and self.y == other.y
|
|
31
|
+
|
|
32
|
+
def __str__(self):
|
|
33
|
+
return f"A Rocket positioned at ({self.x},{self.y})"
|
|
34
|
+
|
|
35
|
+
def __repr__(self):
|
|
36
|
+
return f"Rocket({self.x},{self.y})"
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class Shuttle(Rocket):
|
|
40
|
+
# Shuttle simulates a space shuttle, which is really
|
|
41
|
+
# just a reusable rocket.
|
|
42
|
+
|
|
43
|
+
def __init__(self, x=0, y=0, flights_completed=0):
|
|
44
|
+
super().__init__(x, y)
|
|
45
|
+
self.flights_completed = flights_completed
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class CircleRocket(Rocket):
|
|
49
|
+
# CircleRocket models a rocket that has the form of a circle
|
|
50
|
+
# with radius r.
|
|
51
|
+
|
|
52
|
+
def __init__(self, x=0, y=0, r=1):
|
|
53
|
+
super().__init__(x, y)
|
|
54
|
+
self.r = r
|
|
55
|
+
|
|
56
|
+
def get_area(self):
|
|
57
|
+
return pi * self.r ** 2
|
|
58
|
+
|
|
59
|
+
def get_circumference(self):
|
|
60
|
+
return 2 * pi * self.r
|
|
61
|
+
|
|
62
|
+
def __str__(self):
|
|
63
|
+
return f"A CircleRocket positioned at ({self.x},{self.y}) with radius {self.r}"
|
|
64
|
+
|
|
65
|
+
def __repr__(self):
|
|
66
|
+
return f"CircleRocket({self.x},{self.y},{self.r})"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from setuptools import setup
|
|
2
|
+
|
|
3
|
+
setup(
|
|
4
|
+
name='package-ta',
|
|
5
|
+
version='1.0.0',
|
|
6
|
+
author='rabia',
|
|
7
|
+
author_email='talebrabia620@gmail.com',
|
|
8
|
+
packages=['rocket'],
|
|
9
|
+
url='http://pypi.python.org/pypi/rocket-ta/',
|
|
10
|
+
license='LICENSE.txt',
|
|
11
|
+
description='An awesome package that does something',
|
|
12
|
+
long_description=open('README.md').read(),
|
|
13
|
+
long_description_content_type="text/markdown",
|
|
14
|
+
|
|
15
|
+
)
|