投稿時間:2023-05-19 18:28:12 RSSフィード2023-05-19 18:00 分まとめ(34件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
Google Google Japan Blog 無効な Google アカウントに関するポリシーを更新しました http://japan.googleblog.com/feeds/5907379865788698957/comments/default ログインしてメールを読む、送信するGoogleドライブを使用するYouTube動画を見るGooglePlayストアからアプリをダウンロードするGoogle検索を使用する「Googleでログイン」でサードパーティ製のアプリやサービスにログインするGoogleアカウントを使って、GoogleOne、ニュースコンテンツ、アプリなどの既存のサブスクリプションを設定している場合も、アカウントはアクティブとみなされ、削除の対象にはなりません。 2023-05-19 17:16:00
python Pythonタグが付けられた新着投稿 - Qiita AzureOpenAI(ChatGPT)を使ったエンタープライズ向けMattermostBotをサクッと実装する https://qiita.com/kita_atsushi/items/2db194b9ec0352e8d22b azureopenaichatgpt 2023-05-19 17:23:57
python Pythonタグが付けられた新着投稿 - Qiita 【Paiza問題集】標準入力メニュー/組になったデータの入力 https://qiita.com/norma2627/items/09ad057f3ba3a9c781ad paiza 2023-05-19 17:06:01
js JavaScriptタグが付けられた新着投稿 - Qiita MapLibre GL JS + deck.gl + Google Photorealistic 3D Tilesを試す https://qiita.com/syanseto/items/3f918d84b3ff9b2db580 deckgl 2023-05-19 17:44:36
Ruby Rubyタグが付けられた新着投稿 - Qiita RubyKaigi 2023@松本行ってきました! https://qiita.com/Take-st/items/3f5e967efc0e88def77d rubykaigi 2023-05-19 17:52:48
Ruby Rubyタグが付けられた新着投稿 - Qiita 【Rails】findとWhereの違い https://qiita.com/fuku_pg/items/17901627b5e3b2df9a36 activerecord 2023-05-19 17:51:43
Ruby Rubyタグが付けられた新着投稿 - Qiita RubyKaigi 2023参加レポート https://qiita.com/okamoto441/items/2b1adf232a2aaefb3f73 officialparty 2023-05-19 17:45:38
golang Goタグが付けられた新着投稿 - Qiita Golang Web API開発入門ガイド https://qiita.com/MYu/items/1c1a93fba22035b45d6a bunorm 2023-05-19 17:46:34
Azure Azureタグが付けられた新着投稿 - Qiita AzureOpenAI(ChatGPT)を使ったエンタープライズ向けMattermostBotをサクッと実装する https://qiita.com/kita_atsushi/items/2db194b9ec0352e8d22b azureopenaichatgpt 2023-05-19 17:23:57
Ruby Railsタグが付けられた新着投稿 - Qiita 【Rails】findとWhereの違い https://qiita.com/fuku_pg/items/17901627b5e3b2df9a36 activerecord 2023-05-19 17:51:43
技術ブログ Developers.IO チームで同じものを鑑賞すると何が見えてくるのか?チームメンバーと美術館へ行きました。 https://dev.classmethod.jp/articles/designer_teambuilding_art/ 鑑賞 2023-05-19 08:37:39
技術ブログ Developers.IO AWS IoT Core Device Advisor で Device Shadow のテストケースを実施する https://dev.classmethod.jp/articles/aws-iot-device-advisor-device-shadow/ awsiotcoredeviceadvisor 2023-05-19 08:13:56
技術ブログ Developers.IO CloudWatch Alarms 설정 시, 취득하지 못 한 메트릭 값 설정하는 방법 https://dev.classmethod.jp/articles/jw-how-to-set-unacquired-metric-values-when-setting-cloudwatch-alarms/ CloudWatch Alarms 설정시 취득하지못한메트릭값설정하는방법안녕하세요클래스메소드김재욱 Kim Jaewook 입니다 이번에는CloudWatch Alarms 설정시 취득하지못한메트릭값을설정하는방법에대해서정리해봤습니다 문제발생A 2023-05-19 08:03:16
海外TECH DEV Community How to build a phone mockup using only Tailwind CSS https://dev.to/themesberg/how-to-build-a-phone-mockup-using-only-tailwind-css-1e5c How to build a phone mockup using only Tailwind CSSToday I would like to show you how you can easily create a phone device mockup using only the classes from Tailwind CSS these components are usually used for hero and CTA sections and using CSS can make them more performant and looking much nicer than using SVG s or screenshots The only prerequisite you need is to have Tailwind CSS installed on your project either via CDN or integrated into the build process Alternatively you can also install Flowbite if you want to use more components that play along nicely with the one that we ll work with but it s not mandatory for this component Here s a preview of how our component will look Without further ado let s get started Building a device mockup with Tailwind CSSThe first thing we need to do is set up the main frame of the component which is the edge of the screen and the device itself Here s how we should do it lt div class relative mx auto border gray dark border gray bg gray border px rounded rem h px w px gt lt other elements and content gt lt div gt This will be the main frame of our phone device and you are free to update the colors and size of the mockup as you wish The next step is to add the control buttons such as for volume control and shut down to make it more realistic lt div class relative mx auto border gray dark border gray bg gray border px rounded rem h px w px gt lt div class h px w px bg gray dark bg gray absolute left px top px rounded l lg gt lt div gt lt div class h px w px bg gray dark bg gray absolute left px top px rounded l lg gt lt div gt lt div class h px w px bg gray dark bg gray absolute left px top px rounded l lg gt lt div gt lt div class h px w px bg gray dark bg gray absolute right px top px rounded r lg gt lt div gt lt screenshot and container gt lt div gt Awesome It s starting to look better The next step is to add a container div and the actual images for the screenshot of your application lt div class relative mx auto border gray dark border gray bg gray border px rounded rem h px w px gt lt div class h px w px bg gray dark bg gray absolute left px top px rounded l lg gt lt div gt lt div class h px w px bg gray dark bg gray absolute left px top px rounded l lg gt lt div gt lt div class h px w px bg gray dark bg gray absolute left px top px rounded l lg gt lt div gt lt div class h px w px bg gray dark bg gray absolute right px top px rounded r lg gt lt div gt lt div class rounded rem overflow hidden w px h px bg white dark bg gray gt lt img src class dark hidden w px h px alt gt lt img src class hidden dark block w px h px alt gt lt div gt lt div gt And there you have it The great news is that this example also supports dark mode that s why we have two images inside the mockup Check out how you can integrate dark mode with Tailwind CSS Here s how it looks with dark mode enabled This example was taken from Flowbite s device mockups page coded with Tailwind CSS If you want to check out more device examples such as tablets alternative phones desktops laptops and even smartwatches then you can check out the full list here Android phone mockupTablet mockupLaptop mockupDesktop mockupSmartwatch mockupHere are the preview images Credits and conclusionThese components can be used to preview your application inside hero or CTA sections and they are very easy to customize directly from your HTML via Tailwind CSS Credits go to the open source Tailwind CSS and Flowbite libraries 2023-05-19 08:45:55
海外TECH DEV Community How to Come Back From Burnout https://dev.to/hb/how-to-come-back-from-burnout-j85 How to Come Back From BurnoutBurnout is tough When you are burnt out from something you resent it and don t want touch it again This unhealthy relationship with that thing only decreases your productivity and your mental health Well this exactly happened with me and programming Learning to code over years ago I thought my relationship with code was great In that short year span that I did code it was my priority making a stark imbalance in my life This imbalance led me to not write another line of code for years until recently After a long break I feel the urge to come back into coding and rekindle my passion that I used to love In this article I will go over the most important things that I kept in mind over this journey of relearning and rediscovering I hope these help you too Address the reasons why you want to come back to codingTo make sure that you will have a healthy relationship with code you need to make sure that you are coming back from burnout for yourself and your needs If you are doing it for other people or purely for the sake of getting a job for example it will be much harder to devote time and effort into coding consistently This would lead to another burnout which is the main thing we are trying to avoid In my case I felt that I had extra time in my life that I wanted to dedicate to a hobby Since programming is something I used to love I wanted to try it again as in combination with me finding it very interesting and worthwhile it is a practical skill for the future In summary make sure that you are coming back from burnout for you and what you want to do This will keep you motivated and interesting in coding Make a planLearning to code and relearning to code is no different you need to make a plan To make sure you aren t all over the place scrambling to learn every technology that you knew previously you need to assemble a plan Something very common with burnout is feeling overwhelmed with all the things you need to do to get back to where you were prior To prevent this feeling you need to take it one step at a time to make your foundations strong but also to maintain that healthy relationship In my case for the past few weeks I ve just been relearning Python the first programming language I learned Since Python is easy to learn I thought it would be a logical starting point for me Although my main programming language was Rust I felt like that would be a harder starting point leading to more roadblocks and possibly being overwhelmed Before you start getting into coding again outline the languages concepts frameworks you want to relearn and the resources that you will use This will keep you on track but also prevent you from being overwhelmed as you have a clear plan to get back to where you were before Furthermore it s rewarding to tick off the tasks that you have completed giving yourself more motivation to continue Make it fun for yourselfIn my journey of returning to coding I have been learning by doing I started off super basic wanting to make a command line contact book in Python I outlined the different things that I would need to do in order to complete this project and just went into it attempting to rekindle my knowledge along the way If you don t know how to do something AI and documentation is your friend This made the process of relearning the nitty gritty of Python more fun and enjoyable for me Joining communities is another amazing way to make the experience fun There is a great community here on DEV and writing blog posts about your experiences for example will help you stay accountable to your relearning process but also engage with the community by asking for questions or just sharing how you have been recovering from burn out Find a supportive community that will lift you up and be there if you have any questions or concerns Take breaksIn order to ensure that you don t get burned out again you need to take breaks Maintaining a healthy relationship with code relies on the fact that you have other things to turn too when you get stumped or just need a break For me I enjoy physical exercise sports and spending time with family and friends These activities take my mind off coding and allow me to take a break Finding what works for you is crucial to maintaining that healthy relationship Here are some ideas of activities you can do to get your mind off coding physical exercise spending time with friends family meditation reading art music etc Check in once in a while to see if your relationship with code is healthyFor me this is the most important point to ensure that your relationship with code stays healthy You need to check in once in a while to see if your life is balanced and your relationship with code is healthy Whether this be scheduled breaks or just reflecting on your mental health taking some time to think about how you can prevent burnout and just enjoy coding is crucial Two years ago when I was doing an immense amount of coding everything seemed perfect as I flew from language to language framework to framework It is not until I was suddenly hit by burnout that I realized that this obsessive learning was unhealthy for me If I took a pause ever so often in my learning journey it would ve allowed me to prevent burnout and have a healthy relationship with coding To conclude make sure you keep these five points in mind when coming back from a burnout Reflection and keeping one s relationship with code healthy is something we oftentimes take for granted That is why it is essential to check in once in a while stay streamlined and always have fun Good luck to all of you coming back from burnout it s always hard You can always reach out to me boisdequinhenry gmail com for any questions Thanks for reading Henry Boisdequin 2023-05-19 08:35:18
海外TECH DEV Community Extracting addresses from OpenStreetMaps https://dev.to/dagnelies/extracting-addresses-from-openstreetmaps-5g2i Extracting addresses from OpenStreetMaps Why Because there is no worldwide quality source for addresses Really that s no joke There are many commercial providers for industrialized countries of variable quality pricing but worldwide coverage is lacking the data formats are diverse and the license terms provider specific There are also some open source projects related to addresses though each with their gochas Two of these projects are mentioned in the last section Honorable Mentions at the end of this article along with their drawbacks This project is born in order to provide quality addresses with worldwide coverage under an open license by directly extracting addresses from the raw data dumps of OpenStreetMap Birth of OpenStreetData orgHow does the it look like Here is a screenshot but if you prefer check out the website directly It is divided into two parts extracts and addresses Another points of interest was planned but not further developed due to lack of time Country dumpsCountry extracts are provided in two formats PBF the native OpenStreetMap binary format This format is very compact and many tools can handle it efficiently Nevertheless it is not always very practical to handle due to its low level nature It s basically a huge list of points with IDs lines that reference these IDs and relations that reference the lines GeoJson sequences It s a text file where each line is a feature a JSON object with arbitrary properties and a geometry with coordinates Although the file size is typically larger and the processing sometimes slower it offers other benefits The JSON format is universal the line based sequence makes it straightforward to filter it with grep like tools and the geometry can be parsed directly without requiring to go through the whole file Note though that both formats are not equivalent During the conversion process some choices were required to be made In particular in the original PBF a closed line where the last point is the same as the first could be interpreted as a line or as an area either way There is no clear cut indication whether it s a line happening to turn in a circle like a roundabout or a polygonal area like a building outline This led to closed lines being interpreted as lines or polygons based on a lot of hand picked feature properties For example if building was part of the properties it was considered a polygon except if an area false tag was also present and so on Administrative areasDespite not being shown on the site extracting precise boundaries of a country s provinces regions counties cities suburbs and so on was the first crucial step How a country is subdivided into smaller areas varies greatly from country to country and is abstracted under the name administrative areas of various levels This step is crucial because of the way addresses are extracted Streets and houses were extracted using spatial joins with the administrative areas Their coordinates were used to determine which administrative areas city county province they belong to as well as the postal code if postal code areas are defined in the country Currently the reason of missing or wrong addresses for some countries are improper mapping of the administrative areas StreetsHere is an example of the streets for Austria suburbcountrystateprovincecitypostal codestreet nameAbtsdorfATOberösterreichBezirk VöcklabruckAttersee am AtterseeAbtsdorfAbtsdorfATOberösterreichBezirk VöcklabruckAttersee am AtterseeAltenbergAbtsdorfATOberösterreichBezirk VöcklabruckAttersee am AtterseeAttergauer LandesstraßeAbtsdorfATOberösterreichBezirk VöcklabruckAttersee am AtterseeAtterseeAbtsdorfATOberösterreichBezirk VöcklabruckAttersee am AtterseeAtterseestraße ATVorarlbergBezirk FeldkirchMarktgemeinde RankweilWüstenrotgasseATVorarlbergBezirk FeldkirchMarktgemeinde RankweilZehentstraßeATVorarlbergBezirk FeldkirchMarktgemeinde RankweilZieglerwegATVorarlbergBezirk FeldkirchMarktgemeinde RankweilZunftgasseATVorarlbergBezirk FeldkirchMarktgemeinde RankweilÜbersaxner Straße rows × columnsIt extracted all streets having a name from the raw data and determined the administrative areas and postal code it belongs according to their centroid As such it is a slightly simplified streets list If a street might cross multiple cities or postal codes for example it will solely be listed in the main one according to its center For more precise addresses see below Note that suburb may be empty depending on the size of the city This is normal since not all cities are further divided into suburbs HousesHouses is a dataset listing each house anything with a house number individually including its coordinates and the administrative areas it lies within AddressesIn this case the houses are merged into streets with house numbers Unlike the streets approach it results in a more fine grained dataset it includes only streets with at least a single house number it differentiates between street sections with house number ranges belonging to different administrative areas or postal codesit differentiates between different sides of the street with odd even house numbers belonging to different administrative areas or postal codesit has boundariesHere is an example of such an address file for Austria postal codecitystreetx minx maxy miny maxhouse minhouse maxhouse oddhouse evenViennaWeihburggasseTrueTrueWienAbraham a Sancta Clara GasseTrueTrueWienAkademiestraßeTrueTrueWienAlbertinaplatzTrueTrueWienAlte WalfischgasseTrueTrue Gemeinde DölsachWaidachwegTrueTrueGemeinde DölsachWenzl PLatzTrueTrueGemeinde Iselsberg StronachGroßglockner StraßeTrueTrueGemeinde Iselsberg StronachIselsbergTrueTrueGemeinde Iselsberg StronachStronachTrueTrue rows × columnsIt may not be perfect for example the first line with a misinterpreted city name is quite mysterious Challenges Big Data Dealing with large data is challenging It s not thousands of points it s not millions it s many billions of points lines polygons and relations Seems like a detail Well for example you cannot even load the planet s data at once in memory It s simply too big You cannot just do as you please with inefficient code Every line of code every operation must be crafted with care well thought out and fine tuned to keep processing time and memory to a minimum As an example just for processing the data of a single country even Gb RAM is not enough for larger countries and it takes many hours with the current code despite best efforts Producing precise country extractsThere are sites like geofabrik de providing country extracts to download However they turned out to be not precise enough for me They use simplified country border polygons that are cutting corners and therefore missing addresses in areas near the borders So I had to split the planet myself To do so the first step was to extract exact country boundaries Interestingly these might change over time Usually it s minor modifications like slightly adjusting the border or correcting mistakes But sometimes the border might move a bit more in unstable parts of the world The point here is that these borders are not definitive but evolve slightly over time The next step is splitting the world into country extracts Here again it cannot be naively done in a single step Doing so even Gb RAM would not suffice to split at once So the splitting must be done in multiple steps first in continents then in regions then in countries so that it fits in a reasonable amount of memory And cutting whole continents with a super precise boundary constituted from millions of points is not efficient either On the other hand computing the total bounds of the continent is pointless too For example the outer bounds of just France would cover almost the whole world since it possesses many islands around the world as part of its territory You get the point some extra work must be done to simplify the geometry without losing stuff but without including too much either Then there are ways or area relations that cross boundaries Some things from the raw data are not always clear whether it s a closed line or an area and so on It s full of technical details which make even producing what look like simple country extracts challenging Heterogenous dataThe OpenStreetMap raw data is not a homogenous clearly defined dataset It is a huge amount of points lines and relations each with completely arbitrary properties For example a statue might be a point with metadata indicating when it was built and from whom along with some tourist guide number Depending on where you look on the map you may also notice different habits of mappers using a diversified arsenal of tags to describe things and the community as a whole has different opinions on how to do things for example with addresses which often have local flavours If you dig into the raw data of OpenStreetMap you will find interesting things For example you will find tags like addr street and addr city which sounds promising These are also very simple and quick to extract since it s attached directly to the data Great right Well it would be this data was complete but it is far from Depending on the country you are looking at it might be mostly widespread or barely used Even if it s there the coverage and the content are usually quite fuzzy For example the street might be named Wall Street on one building while another building uses Wall St Likewise the city in one building may be N Y City while another uses New York Postcodes may also be written in individual houses but not match the postal boundary accurately etc This makes processing these tags directly error prone It s better than nothing but there are ways to make it better Namely what we did Spatial joins of houses streets points into administrative postal areas in order to extract the most information possible If those areas are not mapped a fallback to the tags is used but only as fallback since they are usually not that precise Manual laborDoing this is quite some work It s not just running a process and be done with it It s craftsmanship where you change a few lines of code and manually inspect the results Just checking if more streets houses addresses are produced is not sufficient either It might be that the output is of worse quality because street names are duplicated or listed in the wrong areas or some other data mistakes It might also be that the couple of lines change works perfectly for one country but breaks in another because of local differences like for example the presence or absence of postal codes Sometimes you also see odd things in the data When this happens you usually spend some time to investigate why it is so Is it the raw map data that is strange Is it some situation you did not think of Is there a bug in the code Is some third party library not working as expected It s really full of weird things from buildings on the map having mistakenly used national boundaries tags to sudden performance drops in third party libraries when calling a certain function Addresses are crazyBelow I will illustrate how addresses are crazy It s not something that is homogenous worldwide It s full of regional quirks Is it a country or not You may think that something as basic as countries and boundaries is clear cut But it is not Take Kosovo for example For half of the world marked in red Kosovo constitutes a province of Serbia while for the other half of the world marked in blue Kosovo is recognized as an independent country and that s not unique to Kosovo There are plenty of regions in the world where territory is disputed where border shift with local wars and where sovereignty depends on who you ask What stance do I take here I simply use the list of countries as defined by the united nations defined by their country codes ISO It might not be ideal but it is pragmatic A city with many bordersOn a small scale level borders can be crazy too For example check out the little town of Baarle Nassau located in the south of the Netherlands near the Belgium border This town contains small exclaves of the Belgian town Baarle Hertog some of which contain counter exclaves of Nassau The borders cross streets in the middle sometimes multiple times and a single house might have a Belgium address on one side and a Netherlands address on the other As you see extracting addresses can quickly become challenging A city center without street namesNot all addresses are based on streets Take a look a Mannheim for example There the city center is divided like a big grid There each block has an identifier like C while the streets are unnamed Likewise house number does not belong to a street but to a block In other words your address might be C if you live in building of block C Fancy house numbersDo you want to use regexes to filter valid house numbers Well that might not really work out For example the following image is a valid Vietnamese house number near the coasts of Ho Chi Minh city The world is full of surprises Also regarding addresses it s full of diversity and local quirks and I believe there is nothing that does not exist Honorable mentionsThere are also two noticeable open source projects trying to bring addresses to the public domain openaddresses ioThis is probably the most famous one It works by running various scraping scripts against various raw data sources The result of this approach has few drawbacks though directly related to its approach the licensing is problematic Basically it says use this data according to the license from the data source which is not obvious since the original issue is not directly linked often in native language and the licensing terms makes the usage of this data questionable the coverage is lackingthe scraping sometimes breaks or is outdated because of changes in the raw sourcedespite being open some things are obfuscated and make reproducing or direct downloads difficultosmnames orgDespite less known this is IMHO a better source of addresses It is based on addresses extraction from OpenStreetMap and therefore has worldwide coverage and a homogenous license the ODbL Open Database License The only drawback it has IMHO is the lack of postal codesthe admin level mapping not idealThe lack of postal codes may seem like a detail but it is crucial for addresses Without it addresses are simply incomplete Since this project is open source I also tried to improve it by adding postal code see issue but it turned out too be too difficult challenging for me Mostly because I am unfamiliar with PostGIS The code however is of quality This lead me to the current project The second issue is more subtle and leads to missing addresses in some countries because administrative boundaries are not properly mapped Also the code is not suited for experimentation and from my understanding there were ways to get more out of the raw OpenStreetMap data dumps than how they did it 2023-05-19 08:19:52
海外TECH DEV Community Export an OpenAPI specification from your FastAPI app https://dev.to/doctave/export-an-openapi-specification-from-your-fastapi-app-5363 Export an OpenAPI specification from your FastAPI appFastAPI is a modern Python web framework for building APIs FastAPI is a great choice for building simple APIs and it comes with built in support for generating OpenAPI documentation In this post we will look at how to generate and extract the OpenAPI specification from a FastAPI project A simple single file FastAPI example taken from the official docs will suffice as our testbed The same workflow will also work for larger projects with routers Step Add Tags and MetadataChances are that you ll use the OpenAPI spec to generate documentation or code It is important to add metadata to your FastAPI app so that the generated OpenAPI spec is complete Firstly you should tag our endpoints with tags to make sure they are grouped in logical operations This example does not use routers but if you do you need to tag the router instead of the endpoint Tags are used by documentation and code generators to group endpoints together Tags may include spaces and special characters but we recommend to keep the tags simple It is common to use either lowercase or Capital Case for tags like Items in our example In addition to tags we ll add a description and version metadata to our FastAPI app instance The description and version will be used in the generated OpenAPI docs on the overview page You can find the full list of metadata parameters in the FastAPI docs if you need to include additional details in your specification The full example main py now looks like this main pyfrom fastapi import FastAPIfrom pydantic import BaseModelapp FastAPI description Example app version class Item BaseModel name str description str None None price float tax float None None tags list str app post items tags Items async def create item item Item gt Item return item app get items tags Items async def read items gt list Item return Item name Portal Gun price Item name Plumbus price This example requires pip install fastapi all and pip install pydantic to run Step Create the Export ScriptBy default FastAPI will generate OpenAPI docs under docs You can try this out by running the app and navigating to http localhost docs It is possible to get the OpenAPI JSON directly by navigating to openapi json but we ll want to extract the document programmatically in order to be able to automate the process FastAPI does not support exporting the OpenAPI specification directly but we ll use a small script to extract it Create a file extract openapi py with the following contents extract openapi pyimport argparseimport jsonimport sysimport yamlfrom uvicorn importer import import from stringparser argparse ArgumentParser prog extract openapi py parser add argument app help App import string Eg main app default main app parser add argument app dir help Directory containing the app default None parser add argument out help Output file ending in json or yaml default openapi yaml if name main args parser parse args if args app dir is not None print f adding args app dir to sys path sys path insert args app dir print f importing app from args app app import from string args app openapi app openapi version openapi get openapi unknown version print f writing openapi spec v version with open args out w as f if args out endswith json json dump openapi f indent else yaml dump openapi f sort keys False print f spec written to args out What this script does is import the app from the given import string and then call app openapi to get the OpenAPI spec The spec is then written to the given output file You can invoke help to see the available options python export openapi py helpusage extract openapi py h app dir APP DIR out OUT apppositional arguments app App import string Eg main app options h help show this help message and exit app dir APP DIR Directory containing the app out OUT Output file ending in json or yamlIf you have trouble with the uvicorn import make sure you have installed the fastapi all package which includes uvicorn or that you have uvicorn installed Step Export OpenAPI spec from FastAPI Running the scriptTo run the export script you need to know the import string of your FastAPI app The import string is is what you pass to uvicorn when running your app like uvicorn main app This depends on where your code is located and what the FastAPI instance is called See below for tips on how to determine the import string Run the script by passing the import string of your FastAPI app If you don t know the import string see below for examples python extract openapi py main appThis should create an openapi json or openapi yaml file in your current directory Example case simple project structureIn our example we have a project structure like this my project├ーextract openapi py└ーmain pyOur FastAPI instance is app since we wrote app FastAPI in main py We also have a single file main py in the current directory so the import string is main app To extract the OpenAPI spec we do python extract openapi py main app Example case nested project structureFor larger applications the project structure is often more nested like this my project├ーextract openapi py└ーmyapp └ーmain pyIn this case we ll have to add the module name myapp to the import string The import string is now myapp main app Alternatively if you are having trouble with this you can use the app dir argument to specify the directory containing the entrypoint of your application In this case to extract the OpenAPI spec we do python extract openapi py myapp main app or alternatively python extract openapi py app dir myapp main appYou should now have the openapi json or openapi yaml file in your current directory Step Automate in your CI CD pipeline optional How you ll integrate the extraction to your CI CD depends on what you are trying to accomplish The three most common ways to approach this are Extract the spec locally and commit it to your repository Let CI CD verify the committed spec is up to date Extract the spec as part of your CI CD pipeline and use the spec as a temporary file to accomplish something eg generate a client Extract the spec as part of your CI CD pipeline and commit the generated spec to your repository when merging to main The benefit with using a script is that it can also be run locally Locally committing is often a safe and straight forward approach but may occasionally make merging more difficult If however you only need to generate the OpenAPI spec as part of your CI CD pipeline you should also consider dedicated GitHub Actions As an example we ll demonstrate a GitHub Actions job which verifies that the committed spec matches a generated one github workflows main ymlname CIon push jobs extract openapi runs on ubuntu latest steps uses actions checkout v name Setup Python uses actions setup python v with python version name Install dependencies run python m pip install upgrade pip pip install r requirements txt name Extract OpenAPI spec run python extract openapi py main app out openapi generated yaml Do something with the generated spec here For example validate that the committed spec matches the generated one name Verify OpenAPI spec has been updated run git diff exit code openapi yaml openapi generated yaml SummaryIn summary we haveAdded tags to each endpoint or routerAdded description version and other metadata to our FastAPI app instanceCreated a script extract openapi py to extract the OpenAPI spec from FastAPIAutomated the extraction in CI CD pipeline 2023-05-19 08:14:50
海外TECH DEV Community Top 10 ChatGPT Plugins You Can't miss https://dev.to/jon_snow789/top-10-chatgpt-plugins-you-cant-miss-1k68 Top ChatGPT Plugins You Can x t missThe death of Google and search is near OpenAI just released ChatGPT Plugins to everyone ChatGPT Plugins to transform your productivity Code InterpreterThis gives ChatGPT the power to write Python Code and work with files It s like this ChatGPT Knows when it can t do something but a piece of code could Code Interpreter allows it to write and run that code This is huge Use cases Excel spreadsheet analysis image manipulation and many many other things ChatGPT Code Interpreter Magic AndrewMayne Video InsightsThis plugin pulls in the transcript of any YouTube or Dailymotion video You can then work with that transcript in ChatGPT Useful if you re trying to speed watch a particular YouTube series and synthesize information AskYourPDFShare a link to a PDF of your choice and ask ChatGPT any questions about that PDF It can do everything from summarizing the PDF to answering specific questions about dates numbers and facts Jon Snow alarmssnooze AskYourPDF Chat GPT PluginShare a link to a PDF of your choice and ask ChatGPT any questions about that PDF It can do everything from summarizing the PDF to answering specific questions about dates numbers and facts AM May Official Website AmbitionStop spending hours searching for jobs online Tell the Ambition plugin what kind of roles you re looking for and it will sort through millions of job openings online and share the best ones with you instantly ZapierSave hours every week by delegating and automating tasks right within ChatGPT Do everything from email automation to updating databases with a few short lines of instruction Link ReaderThis plugin reads the content from all sorts of links like websites news articles Word documents and answers any questions you have about the content from that link Prompt PerfectWant to get something from ChatGPT but not sure what prompt to use The Prompt Perfect plugin crafts the perfect prompt to help you get the answer you re looking for This is a really cool plugin that will expand your prompt and optimize it without you needing to do anything You can write something simple like Summarize the industry structure of the skincare industry Use Prompt Perfect Prompt Perfect will rewrite your prompt to be longer and more detailed to ensure you get the best output NoteableThis is a tool that lets you create data visualization and analysis notebooks from within ChatGPT Paste in a link to some data and provide some context about your analysis goals Noteable will setup an entire analysis for you KraftfulKraftful bills itself as a product development coach You can use Kraftful to ask questions about building product source the industry s best practices and have it provide feedback on what you re working on within ChatGPT Show MeThis is a diagramming plugin If you need to explain how something works or map out the knowledge structure you can use Show me to do it Plugins are only available for Plus users Support usThanks for Reading ️ Check my website Demo coding for updates about my latest CSS Animation CSS Tools and some cool web dev tips Let s be friends Don t forget to subscribe to our channel Demo code Jon Snow alarmssnooze Recruiters are like We are looking for a rockstar frontend developer that can write machine learning algorithms in HTML AM May If you know of any great plugins please let me know in the comments section 2023-05-19 08:02:01
医療系 医療介護 CBnews 国備蓄のアイソレーションガウンと手袋を売却-厚労省コロナ対策推進本部物資班が事務連絡 https://www.cbnews.jp/news/entry/20230519172439 新型コロナウイルス 2023-05-19 17:45:00
金融 JPX マーケットニュース [東証]上場廃止等の決定:(株)メタップス https://www.jpx.co.jp/news/1023/20230519-11.html 上場廃止 2023-05-19 17:10:00
ニュース BBC News - Home Andy Rourke: The Smiths bassist dies aged 59 https://www.bbc.co.uk/news/entertainment-arts-65644596?at_medium=RSS&at_campaign=KARANGA cancer 2023-05-19 08:45:58
ニュース BBC News - Home Legal migration is too high, PM says https://www.bbc.co.uk/news/uk-politics-65643684?at_medium=RSS&at_campaign=KARANGA migrants 2023-05-19 08:02:33
ニュース BBC News - Home West Ham players confront fan attack on family area https://www.bbc.co.uk/sport/football/65642241?at_medium=RSS&at_campaign=KARANGA alkmaar 2023-05-19 08:27:09
ニュース BBC News - Home Agency refuses to hand over Harry photos https://www.bbc.co.uk/news/world-us-canada-65642614?at_medium=RSS&at_campaign=KARANGA agency 2023-05-19 08:21:40
ニュース BBC News - Home What it’s like interviewing the prime minister https://www.bbc.co.uk/news/uk-politics-65645060?at_medium=RSS&at_campaign=KARANGA chris 2023-05-19 08:46:41
ビジネス 不景気.com 中部国際空港の23年3月期は73億円の赤字継続、次期も赤字 - 不景気com https://www.fukeiki.com/2023/05/centrair-2023-loss.html 中部国際空港 2023-05-19 08:39:19
ニュース Newsweek 「クレイジーな誇張」「全然ちがう」...ヘンリーとメーガン「カーチェイス」主張に、当事者も大反論 https://www.newsweekjapan.jp/stories/world/2023/05/post-101674.php 2023-05-19 17:45:00
ニュース Newsweek 「∞プチプチ」なんてどう思いつくの? アイデア溢れる会議の秘訣はカプセルトイにあった https://www.newsweekjapan.jp/stories/business/2023/05/post-101656.php 僕自身も、「これを考えた人、変態かな」と思われるようなアイデアを考えたいという強い欲求があるからこそ、問いを考えることに夢中になるんです。 2023-05-19 17:27:00
IT 週刊アスキー 『Ed-0: Zombie Uprising』の特典情報を公開!プレオーダーもスタート https://weekly.ascii.jp/elem/000/004/137/4137431/ edzombieuprising 2023-05-19 17:50:00
IT 週刊アスキー 夜景×ビール×BBQを楽しもう! 「横浜ベイクォーター BBQビアガーデン」5月26日〜10月15日 https://weekly.ascii.jp/elem/000/004/137/4137413/ 横浜ベイクォーター 2023-05-19 17:30:00
IT 週刊アスキー プラネックス、人の動きを検出して自動追跡撮影も可能な「スマカメ パン・チルト(CS-QS10PT)」発売 https://weekly.ascii.jp/elem/000/004/137/4137406/ csqspt 2023-05-19 17:45:00
IT 週刊アスキー Beats、ANC機能などがさらに向上した最新モデル「Beats Studio Buds +」を発売 https://weekly.ascii.jp/elem/000/004/137/4137355/ beats 2023-05-19 17:30:00
マーケティング AdverTimes 飲食店のデジタルツール導入 45.5%の経営者が興味ありと回答 https://www.advertimes.com/20230519/article419695/ 飲食店 2023-05-19 08:27:57
マーケティング AdverTimes 大相撲の聖地・両国に巨大な「猿桜」が降臨、Netflixシリーズ『サンクチュアリ ‐聖域‐ 』プロモーション https://www.advertimes.com/20230519/article419655/ 大相撲の聖地・両国に巨大な「猿桜」が降臨、Netflixシリーズ『サンクチュアリ聖域』プロモーション大相撲をテーマにしたネットフリックスのオリジナルドラマ『サンクチュアリ聖域』全話が、年月日より配信され、話題を集めている。 2023-05-19 08:21:38

コメント

このブログの人気の投稿

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2020-12-01 09:41:49 RSSフィード2020-12-01 09:00 分まとめ(69件)