2022-05-02 16:14:22 +08:00
< div id = "top" > < / div >
<!-- PROJECT SHIELDS -->
[< div align = "center" > ![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![MIT License][license-shield]][license-url]
[![Issues][issues-shield]][issues-url]
[![Issues Closed][issues-closed-shield]< / div > ][issues-closed-url]
< br / >
<!-- PROJECT LOGO -->

< br / >
< div align = "center" >
< p align = "center" >
< a href = "https://github.com/compose-viz/compose-viz #usage " >< strong > Explore Usage »</ strong ></ a >
< br / >
< br / >
< a href = "https://github.com/compose-viz/compose-viz/issues" > Report Bug< / a >
·
< a href = "https://github.com/compose-viz/compose-viz/issues" > Request Feature< / a >
< / p >
< / div >
<!-- TABLE OF CONTENTS -->
< details >
< summary > Table of Contents< / summary >
< ol >
< li >
< a href = " #about -the-project" > About The Project</ a >
< / li >
< li >
< a href = " #getting -started" > Getting Started</ a >
< ul >
2022-05-25 21:27:10 +08:00
< li >< a href = " #prerequisities " > Prerequisities</ a ></ li >
2022-05-15 19:24:36 +08:00
< li >< a href = " #installation " > Installation</ a ></ li >
2022-05-26 02:00:30 +08:00
< li >< a href = " #example " > Example</ a ></ li >
2022-05-02 16:14:22 +08:00
< li >< a href = " #usage " > Usage</ a ></ li >
< li >< a href = " #options " > Options</ a ></ li >
< / ul >
< / li >
< li >< a href = " #roadmap " > Roadmap</ a ></ li >
< li >< a href = " #contributing " > Contributing</ a ></ li >
< li >< a href = " #license " > License</ a ></ li >
< li >< a href = " #contact " > Contact</ a ></ li >
< / ol >
< / details >
<!-- ABOUT THE PROJECT -->
## About The Project
2022-05-28 03:02:25 +08:00
`compose-viz` is a compose file visualization tool that follows [compose-spec ](https://github.com/compose-spec/compose-spec/blob/master/spec.md ) and allows you to gernerate graph in several formats.
2022-05-25 21:27:10 +08:00
If you are looking for a compose file vizualization tool, and you are using one of the [compose-spec ](https://github.com/compose-spec/compose-spec/blob/master/spec.md ) implementations (e.g. [docker-compose ](https://github.com/docker/compose )/[podman-compose ](https://github.com/containers/podman-compose )), then `compose-viz` is a great choice for you.
2022-05-02 16:14:22 +08:00
< p align = "right" > (< a href = " #top " > back to top</ a > )</ p >
<!-- GETTING STARTED -->
## Getting Started
2022-05-25 21:27:10 +08:00
### Prerequisities
#### Graphviz
2022-05-26 11:06:06 +08:00
You need to install [Graphviz ](https://graphviz.org/download/ ) to generate graphs.
2022-05-25 21:27:10 +08:00
2022-05-15 19:24:36 +08:00
### Installation
#### Using `pip`
`pip install compose-viz`
#### Using `.whl`
See [releases ](https://github.com/compose-viz/compose-viz/releases ).
2022-05-29 16:38:13 +08:00
#### Docker Image
See [wst24365888/compose-viz ](https://hub.docker.com/r/wst24365888/compose-viz/tags ).
2022-05-26 02:00:30 +08:00
### Example
2022-05-26 10:18:36 +08:00
This example yml is from [docker compose beginner tutorial ](https://github.com/docker/labs/blob/master/beginner/chapters/votingapp.md ).
2022-05-26 09:07:10 +08:00
```bash
2022-05-26 10:18:36 +08:00
cd examples/voting-app/
2022-05-29 16:38:13 +08:00
# using python script
2022-05-26 11:08:20 +08:00
cpv -m svg docker-compose.yml
2022-05-29 16:38:13 +08:00
# using docker image
docker run --rm -it -v $(pwd):/in wst24365888/compose-viz -m svg docker-compose.yml
# using docker image in powershell
docker run --rm -it -v ${pwd}:/in wst24365888/compose-viz -m svg docker-compose.yml
2022-05-26 09:07:10 +08:00
```
2022-05-26 02:00:30 +08:00
2022-05-26 02:01:36 +08:00
And this is what the result looks like:
2022-05-26 02:00:30 +08:00
2022-05-26 11:06:06 +08:00

2022-05-26 02:00:30 +08:00
2022-05-26 11:06:06 +08:00
Check out the result [here ](https://github.com/compose-viz/compose-viz/blob/main/examples/voting-app ).
2022-05-26 02:00:30 +08:00
2022-05-02 16:14:22 +08:00
### Usage
2022-05-15 19:24:36 +08:00
`cpv [OPTIONS] INPUT_PATH`
2022-05-02 16:14:22 +08:00
### Options
2022-05-28 02:36:53 +08:00
| Option | Description |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `-o, --output-filename` | Output filename for the generated visualization file. [default: compose-viz] |
| `-m, --format` | Output format for the generated visualization file. See [supported formats ](https://github.com/compose-viz/compose-viz/blob/main/compose_viz/models/viz_formats.py ). [default: png] |
2022-12-15 11:45:49 +01:00
| `-r, --root-service` | Root of the service tree (convenient for large compose yamls) |
2022-05-28 02:36:53 +08:00
| `-v, --version` | Show the version of compose-viz. |
| `--help` | Show help and exit. |
2022-05-02 16:14:22 +08:00
< p align = "right" > (< a href = " #top " > back to top</ a > )</ p >
<!-- ROADMAP -->
## Roadmap
2022-05-25 21:27:10 +08:00
- [ ] Support more vizualization components.
2022-05-02 16:14:22 +08:00
See the [open issues ](https://github.com/compose-viz/compose-viz/issues )
for a full list of proposed features (and known issues).
< p align = "right" > (< a href = " #top " > back to top</ a > )</ p >
<!-- CONTRIBUTING -->
## Contributing
Contributions are what make the open source community such an amazing place to
learn, inspire, and create. Any contributions you make are **greatly
appreciated**.
If you have a suggestion that would make this better, please fork the repo and
create a pull request. You can also simply open an issue with the tag
"enhancement". Don't forget to give the project a star! Thanks again!
1. Fork the Project
2. Create your Feature Branch (`git checkout -b feat/amazing-feature` )
3. Commit your Changes with
[Conventional Commits ](https://www.conventionalcommits.org/en/v1.0.0/ )
4. Push to the Branch (`git push origin feat/amazing-feature` )
5. Open a Pull Request
< p align = "right" > (< a href = " #top " > back to top</ a > )</ p >
<!-- LICENSE -->
## License
Distributed under the MIT License. See
[LICENSE ](https://github.com/compose-viz/compose-viz/blob/main/LICENSE )
for more information.
< p align = "right" > (< a href = " #top " > back to top</ a > )</ p >
<!-- CONTACT -->
## Contact
### Author
- HSING-HAN, WU (Xyphuz)
- Mail me: xyphuzwu@gmail .com
- About me: < https: // about . xyphuz . com >
- GitHub: < https: // github . com / wst24365888 >
### Project Link
- < https: // github . com / compose-viz / compose-viz >
< p align = "right" > (< a href = " #top " > back to top</ a > )</ p >
[contributors-shield]: https://img.shields.io/github/contributors/compose-viz/compose-viz.svg?style=for-the-badge
[contributors-url]: https://github.com/compose-viz/compose-viz/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/compose-viz/compose-viz.svg?style=for-the-badge
[forks-url]: https://github.com/compose-viz/compose-viz/network/members
[stars-shield]: https://img.shields.io/github/stars/compose-viz/compose-viz.svg?style=for-the-badge
[stars-url]: https://github.com/compose-viz/compose-viz/stargazers
[issues-shield]: https://img.shields.io/github/issues/compose-viz/compose-viz.svg?style=for-the-badge
[issues-url]: https://github.com/compose-viz/compose-viz/issues
[issues-closed-shield]: https://img.shields.io/github/issues-closed/compose-viz/compose-viz.svg?style=for-the-badge
[issues-closed-url]: https://github.com/compose-viz/compose-viz/issues?q=is%3Aissue+is%3Aclosed
[license-shield]: https://img.shields.io/github/license/compose-viz/compose-viz.svg?style=for-the-badge
2022-12-15 11:45:49 +01:00
[license-url]: https://github.com/compose-viz/compose-viz/blob/main/LICENSE